22,209
社区成员
发帖
与我相关
我的任务
分享
select * from (
select *,rank () over(partition by day(日期) order by 日期) rk from tb
) t
where t.rk<=10
select * from tb a where 单号 in(select top 10 单号 from tb where 日期=a.日期 order by 单号)
select b.* from tb a
cross apply(select top 10 * from tb where 日期=a.日期) b
select
distinct b.*
from
tb a
cross apply
(select top 10 * from tb where convert(varchar(10),日期,120)=convert(varchar(10),t.日期,120))b