(SELECT user_id, COUNT(*) c_total FROM c GROUP BY user_id) j, (SELECT user_id, COUNT(*) d_total FROM d GROUP BY user_id) k,
WHERE m.user_id = n.user_id AND m.user_id = j.user_id AND m.user_id = k.user_id
in后边的sql有问题。你试试单独运行“select pid from repost group by pid order by count(pid) desc limit 0, 3”。估计会保错。
查出A表中 id , 其对应B表中字母为A,Cselect id from A where id in (select id from B where 字母 in ('A','C'))
单查B表
select id from B where 字母 in ('A','C')
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)