
asp的小问题,同时查询A,B表的sql语句怎么写的?
a表表字段:id,product,bigidb表字段:id,classname其中a.bigid=b.id,已知a.id,求b.classname这样写好像不对:sele...
a表表字段:id,product,bigid
b表字段: id,classname
其中a.bigid=b.id,已知a.id,求b.classname
这样写好像不对:
select bigclass from Hu_bigclass where id =(select bigid from Hu_product where id="&id&") 展开
b表字段: id,classname
其中a.bigid=b.id,已知a.id,求b.classname
这样写好像不对:
select bigclass from Hu_bigclass where id =(select bigid from Hu_product where id="&id&") 展开
2个回答
2009-10-07
展开全部
"select m.classname from b as m,a as n where n.bigid=m.id and n.id="&id
或者
"select classname from b where id in(select bigid from a where id="&id&")"
或者
"select classname from b where id in(select bigid from a where id="&id&")"
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询