我有一个子查询,它按如下方式计算track_id
SELECT track_id, COUNT( * )
FROM track_comments
GROUP BY track_id
ORDER BY COUNT( * ) DESC
LIMIT 10
我想要做的是根据从此查询收到的track_id
运行查询。怎么办呢?
答案 0 :(得分:0)
select * from your_table
where track_id in
(
SELECT track_id
FROM track_comments
GROUP BY track_id
ORDER BY COUNT( * ) DESC
LIMIT 10
)