1,举例:select full_name '房源名称',CN '合同编号',contract_starttime '开始时间',contract_endtime '结束时间',salement_id '管房人', `owner_id` '业主' ,case contract_status when 5 then '执行中' when 88 then '已结束' else '其余' end from table where contract_endtime>='2018-01-01';cdn
2,select fields, case when CreateTime>'2016-02-14 16:24:42' then 'after' when CreateTime<'2016-02-14 16:24:42' then 'before' else 'now' end stage from table order by field DESC;blog