【发布时间】:2020-10-21 07:22:30
【问题描述】:
我的桌子是
ID FirstName LastName ReportsTo Position Age
8 Ashley Johnson null Intern 25
5 Noah Fritz Jenny Richards Assistant 30
6 David S Jenny Richards Director 32
3 Jenny Richards null CEO 45
我想在上面的表格中添加一列作为“老板标题”,其中的值来自下面的 select 语句。但它不起作用。
SELECT *,
case when ReportsTo='Jenny Richards' then 'CEO'
else 'None' end
as 'Boss Title'
FROM maintable_L8MOQ where ReportsTo='Jenny Richards' or ReportsTo is null order by age;
【问题讨论】:
-
请标记您的 sql 引擎。