有雇员表employee(emID, emSex, emName),其中性别字段emSex使用0表示性别“女”,1表示“男”。如果查询结果的性别字段希望显示“男”、“女”,而不是1、0。正确的SELECT语句是______。
A、SELECT emIDAS员工编号, (WHENemSex='0'THEN'女ELSE'男’END)AS性别, emNameAS姓名FROMemployee;;
B、SELECT emIDAS员工编号, (IFemSex='0'THEN'女ELSE'男’END)AS性别, emNameAS姓名FROMemployee;;
C、SELECT emIDAS员工编号, (CASEWHENemSex='0'THEN'女ELSE'男’END)AS性别, emNameAS姓名FROMemployee;;
D、SELECT emIDAS员工编号, (CASEemSex='0'THEN'女ELSE'男’END)AS性别, emNameAS姓名FROMemployee;
发布时间:2025-01-07 08:07:57