select * from(select top 50 * from(select top 100 * from clients order by phone)t1 order by phone desc)t2 order by phonephone字段有很多null!! 分页没效果了 但是我必须用这个字段排序在分页我试过用order by phone,id 双排序好象也没效果。。我如果用: select * from(select top 50 * from(select top 100 * from clients order by id)t1 order by id desc)t2 order by id 就没错了!
--如果phone是varchar select * from ( select top 50 * from( select top 100 * from clients order by id,isnull(phone,'') )t1 order by id desc,isnull(phone,'') desc ) t2 order by id,isnull(phone,'')
select * from(select top 50 * from(select top 100 * from clients order by id)t1 order by id desc)t2 order by id
就没错了!
select *
from (
select top 50 *
from(
select top 100 *
from clients
order by id,isnull(phone,'')
)t1
order by id desc,isnull(phone,'') desc
) t2
order by id,isnull(phone,'')