sql相关
case 函数
编写查询,按条件合并两列为一列(eg:我想从FullName或FirstName的列中找出不为空的雇员的名字)
SELECT Name = CASE
WHEN EMPLOYEE.FullName IS NOT NULL THEN EMPLOYEE.FullName
WHEN EMPLOYEE.FirstName IS NOT NULL THEN EMPLOYEE.FirstName
END
FROM EMPLOYEE
case 函数
编写查询,按条件合并两列为一列(eg:我想从FullName或FirstName的列中找出不为空的雇员的名字)
SELECT Name = CASE
WHEN EMPLOYEE.FullName IS NOT NULL THEN EMPLOYEE.FullName
WHEN EMPLOYEE.FirstName IS NOT NULL THEN EMPLOYEE.FirstName
END
FROM EMPLOYEE