Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我创建了一个基本案例 when 声明评估员工 ID 列表并确定他们是“培训”还是“付费”。
但是,有些员工的 ID 应该同时具有这两个类别,但它只会显示为“培训”——因为这是他们第一次出现在声明中的位置。
有可能纠正这个吗?
case when People."Record Key" IN ( list of IDs) then 'training' when People."Record Key" IN ( list of IDs ) then 'paid' END
如果你想有两行员工支付和培训,你可以这样做:
SELECT People.Name, 'Training' category FROM People WHERE People."Record Key" IN ( list of IDs ) UNION SELECT People.Name, 'Paid' FROM People WHERE People."Record Key" IN (other list of IDs )