SELECT EmployeeID,Name,Address,case when DepartmentID ='1' then '财务部'
when DepartmentID ='2' then '人力资源部'
when DepartmentID = '3' then '经理办公室'
when DepartmentID ='4' then '研发部'
when DepartmentID = '5' then '市场部' END as DepartmentID
FROM Employees
语句如上,两个字段限制怎么写?
case when
when DepartmentID ='2' then '人力资源部'
when DepartmentID = '3' then '经理办公室'
when DepartmentID ='4' then '研发部'
when DepartmentID = '5' then '市场部' END as DepartmentID
FROM Employees
语句如上,两个字段限制怎么写?
case when
case when DepartmentID ='1' and 条件 then '财务部'
看可不可以
...
when DepartmentID = '3' and XX = 'XX' then 'XXXX'
when DepartmentID = '3' and XX > 'XX' then 'XXXX'
when DepartmentID = '3' and XX < 'XX' then 'XXXX'
...