1、时间戳转日期格式 SELECT DATE_FORMAT(字段名, '%Y-%m-%d %H:%i:%S') AS 字段别名 from tablename 2、使用 case when 语句 a、select name,case when birthday < '1981' then 'old' when birthday > '1988' then 'yong' els 'ok' end yorn from lee; b、select name,case name when 'sam' then 'yong' when 'lee' then 'handsome' else 'good' end from lee; c、case when 语句复合 select name,birthday,case when birthday > '1983' then 'yong' when name = 'lee' then 'handsome' else 'just so so' end from lee; d、常见的‘是’‘否’/男、女应用 CASE WHEN 字段名 = 0 THEN '否' ELSE '是' END 字段别名