1
jjx 2014-10-02 11:37:25 +08:00
select a.field1, a.field2, a.field3, ..., count(b.*) as x from a left outer join b on a.x=b.x
是这个意思吗? |
2
yrdr 2014-10-02 11:42:09 +08:00
这就是纯数据库问题了,很简单一句
SELECT filed1,filed2,(SELECT COUNT(*) FROM b WHERE b.x = a.x LIMIT 1) AS x FROM a WHERE .... |