sql怎么写 id, type 两列,id为主键 ,想取同一type的前10条数据 怎么拼sql 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 select *from tb twhere id in (select top 10 id from tb where type = t.type order by id desc) select *from tb twhere id>=any (select top 10 id from tb where type = t.type order by id desc) ;with aaa as(select row_number() over(partition by type order by id) as row,* from table)select * from aaa where row<=10 select tb.* from tb where tb.id in (select top 10 tb1.id from tb tb1 where tb.type = tb1.type order by a,b ) 学习数据库的 请进一下~~小弟有事相求 变量可以做对象名吗? 新来的 求一sql语句,!!!!急 谢谢 数据库同步,合并复制是基于http的,还是tcp/ip的? 请问如何统计出 前若干条记录占所有记录的比例(就剩下10分了,不好意思) 求助 sql2000的问题 以查询结果为依据的一个存储过程 关于主键的设置 SQL Server中round函数取值 数据库不一致问题
select *
from tb t
where id in (select top 10 id from tb where type = t.type order by id desc)
from tb t
where id>=any (select top 10 id from tb where type = t.type order by id desc)
;with aaa as
(select row_number() over(partition by type order by id) as row,* from table)
select * from aaa where row<=10