发布时间 sql语句
select top 8 name,unit,opinion,Comments, case when [createtime]<dateadd(hh,1,[createtime])then '1小时前' when [createtime]<dateadd(day,1,[createtime]) then '1天前' when [createtime]<dateadd(MONTH,1,[createtime]) then '一个月前' when [createtime]<dateadd(YEAR,1,[createtime]) then '1年前' end as tims from [Sjhd_opinion]