现在的位置: 首页 > 综合 > 正文

一个分类取前两条的sql语句

2013年08月22日 ⁄ 综合 ⁄ 共 99字 ⁄ 字号 评论关闭
 select *
from tb as t1
where id in(
select top 2 id
from tb as t2
where t1.bid=t2.bid
order by id desc)
order by bid, id desc

抱歉!评论已关闭.