标签: tsql case
SQL CASE语句用于什么?举例说明吗?
SELECT Employee_Name, CASE Location WHEN 'alex' THEN Bonus * 2 WHEN 'robin' THEN Bonus *, 5 ELSE Bonus END "New Bonus" FROM Intellipaat_employee;
答案 0 :(得分:3)
它允许您在SELECT子句中嵌入if-else like子句。