如何使用MySQL中的子查询SELECT COUNT对表中的行进行计数?

时间:2018-03-11 10:42:48

标签: mysql

我在MySQL中运行此查询时收到错误Subquery returns more than 1 row

SELECT a.*,
       (SELECT count(a.ads_id) FROM ads) as ads_count 
FROM ads a
INNER JOIN users u 
ON u.user_id=a.user_id 
GROUP BY u.user_id

我错过了什么?

0 个答案:

没有答案