时间:2021-07-01 10:21:17 帮助过:14人阅读
select a.id as aid,a.name as aname,a.money as amoney,b.id as bid from tableb as b left join table as a on b.pid=a.id where 条件 order by time desc limit 0,10 //每页10条,pageNow第几页
这样查出来的已经是二维数组了
select a.*,ifnull(b.c,0) from a left join (select pid,count(0)c from b group by pid)b on a.id = b.pid order by a.id desc limit 0,10;
谢谢,大家的热心解答