SQL中case语句的使用:
1 use TeachingManageSYS 2 go 3 select * , 4 case when Sage >= 20 then ' 成人 ' 5 when Sage < 20 then ' 少年 ' 6 else ' hard ' 7 end FrenightType 8 from StudentInfo 9 where Ssex = ' 男 ' 10 order by FrenightType asc 11 go