问题补充说明:我是这样写的,不知道哪里错了USE YGGLGOSELECT EmployeeID,Name,Address,DepartmentID= ( IF (SELECT DepartmentID FROM Employees)='1' BEGIN RETURN '财务部' END IF (SELECT DepartmentID FROM Employees)='2' BEGIN RETURN '人力资源部' END IF (SELECT DepartmentID FROM Employees)='3' BEGIN RETURN '经理办公室' END IF (SELECT DepartmentID FROM Employees)='4' BEGIN RETURN '研发部' END IF (SELECT DepartmentID FROM Employees)='5' BEGIN RETURN '市场部' END )FROM Employees
SELECTEmployeeID,Name,Address,
casewhenDepartmentID='1'then'财务部'
whenDepartmentID='2'then'人力资源部'
whenD进亚文厂epartmentID='3'then'经理办公室'
whenDepartmentID='4't得需图几hen'研发部'
whenDepartmentID='5'then'市场部'ENDasDepartmentID
FROMEmployees
标签:语句,多重选择,SQL