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]