select * from a t where ctime in(select top 3 ctime from a order by ctime desc) or sort in(select top 3 sort from a order by sort desc) or fast in(select top 3 fast from a order by fast) 不过数据有可能小于9条
如果一定要9条 select * from a order by ctime desc,sort desc,fast 但似乎也不能满足要求
select top 9 * from a order by ctime desc,sort desc,fast
--可能小于9条数据 select top 3 * from tb order by ctime desc union select top 3 * from tb order by sort desc union select top 3 * from tb order by fast
where
ctime in(select top 3 ctime from a order by ctime desc)
or
sort in(select top 3 sort from a order by sort desc)
or
fast in(select top 3 fast from a order by fast)
不过数据有可能小于9条
select * from a
order by ctime desc,sort desc,fast
但似乎也不能满足要求
select top 9 * from a
order by ctime desc,sort desc,fast
--可能小于9条数据
select top 3 * from tb order by ctime desc
union
select top 3 * from tb order by sort desc
union
select top 3 * from tb order by fast