表1
表2
查询语句和结果
结果只显示3条数据,我要显示product表的所有数据,怎么回事?
业精于勤,荒于嬉;行成于思,毁于随。
Please write like this, the reason for this is improper use of group by select p.id,p.productname,p.productcode,p.price,l.num from p left join (select pid, sum(num) as num from wlms_stock group by pid) l on p.id = l.pid
group by should be placed after line 29
Please write like this, the reason for this is improper use of group by
select p.id,p.productname,p.productcode,p.price,l.num from p
left join (select pid, sum(num) as num from wlms_stock group by pid) l on p.id = l.pid
group by should be placed after line 29