select top 10
FList,sortdate,FID,
(case when FEndDate<getdate() then '已过期' else case when FShow=1 then '招聘中' else '已停止' end end) as FStats,
(case when (FZprs is null) or (FZprs='') then '若干' else convert(nvarchar(5),FZprs) end) as FZprs_1,*
from
(
select
(select count(FID) from t_company_zw _list where ((FDel is null) or (FDel=0)) and FCompanyID=20873
and (_list.sortDate>_t1.sortdate or (_list.sortDate=_t1.sortdate and _list.FID>=_t1.FID) )
) as FList,
(select count(FID) from t_company_rseume _t3 where _t3.FcompanyID=20873 and _t3.FDel<>1 and _t3.FZwid=_t1.Fid) as FYpCont,
*
from
t_company_zw _t1
where
FcompanyID= 20873 and ((FDel is null) or (FDel=0))
)_x
order by FList
FList,sortdate,FID,
(case when FEndDate<getdate() then '已过期' else case when FShow=1 then '招聘中' else '已停止' end end) as FStats,
(case when (FZprs is null) or (FZprs='') then '若干' else convert(nvarchar(5),FZprs) end) as FZprs_1,*
from
(
select
(select count(FID) from t_company_zw _list where ((FDel is null) or (FDel=0)) and FCompanyID=20873
and (_list.sortDate>_t1.sortdate or (_list.sortDate=_t1.sortdate and _list.FID>=_t1.FID) )
) as FList,
(select count(FID) from t_company_rseume _t3 where _t3.FcompanyID=20873 and _t3.FDel<>1 and _t3.FZwid=_t1.Fid) as FYpCont,
*
from
t_company_zw _t1
where
FcompanyID= 20873 and ((FDel is null) or (FDel=0))
)_x
order by FList