表字段fid aid content,aid为主键,我想取出fid=2,3,4的每一个fid的前10条记录使用union可以实现但是语句太长了,有没有更短的语句? (select * from copy_article where fid =2 order by hits desc limit 10) union (select * from copy_article where fid =3 order by hits desc limit 10) union (select * from copy_article where fid =3 order by hits desc limit 10) union (select * from copy_article where fid =3 order by hits desc limit 10) union (select * from copy_article where fid =3 order by hits desc limit 10) union (select * from copy_article where fid =3 order by hits desc limit 10)
select fid,aid,[content]from
(select*,rn=ROW_NUMBER() over(partition by fid orderby hits desc) from copy_article where fid in (2,3,4)) t
where rn between1and10