mysql这种select怎么写?
SELECT spId FROM tbl_goods WHERE goodsId=2; /*2为传入的参数*/
SELECT spMemberName FROM tbl_shopInfo WHERE spId=2; /*2为第一条语句的结果*/
SELECT qqNumber FROM tbl_scmember WHERE memberName='hehe';/*hehe为第二语句的结果*/
如果用一条语句得到结果。
------解决方案--------------------
SQL code
select qqNumber from tbl_goods g,tbl_shopInfo s,tbl_scmember t where g.spId=s.spId and s.spMemberName=t.memberName and g.goodsId=2