select ,ApplyEndTime,PartyType,Target,a.Address,PlanTime,a.Description,Requirement,IsOver,CreatorID,ApplyStartTime
from t_ev_party order by ??逻辑是
if (ApplyStartTime > DateTime.Now || ApplyEndTime < DateTime.Now)
{
return "报名准备中";
}
else
{
return "报名进行中";
}
我想让 报名进行中在顶部显示。
from t_ev_party order by ??逻辑是
if (ApplyStartTime > DateTime.Now || ApplyEndTime < DateTime.Now)
{
return "报名准备中";
}
else
{
return "报名进行中";
}
我想让 报名进行中在顶部显示。
from t_ev_party order by case when datediff(day,ApplyEndTime,getdate())=0 then 0 else 1 end
试
from t_ev_party
order by case when datediff(day,ApplyEndTime,getdate())>=0 then 0 else 1 end
from t_ev_party order by (case when (ApplyStartTime > DateTime.Now) or (ApplyEndTime < DateTime.Now) then 1
else 0 end )
select ,ApplyEndTime,PartyType,Target,a.Address,PlanTime,a.Description,Requirement,IsOver,CreatorID,ApplyStartTime
from t_ev_party
order by sign(abs(datediff(day,ApplyStartTime,Getdate())))
select ApplyEndTime,PartyType,Target,a.Address,PlanTime,a.Description,Requirement,IsOver,CreatorID,ApplyStartTime
from t_ev_party
order by case when datediff(ss,ApplyEndTime,getdate())>=0 then 0 else 1 end
from t_ev_party
order by case when (ApplyStartTime > DateTime.Now || ApplyEndTime < DateTime.Now) then 1 else 0 end