select a.gno,a.gname,a.gprice,b.数量 from goods a inner join
(
select gno,count(1) as '数量' from orders where cus_id ='666666' and status=0
group by gno
)b on a.gno = b.gno
select a.gno,b.gname,b.gprice,count(*) 数量
from orders a,goods b where a.gno=b.gno and a.cus_id='666666' and a.status=0
group by a.gno,b.gname,b.gprice
这样试试
select g.Gno,g.Gname,g.Gprice,count(0) as 数量 from Goods G LEFT JOIN orders o ON g.Gno=o.Gno WHERE o.Cus_ID='666666' AND o.status=0 group by o.Gno