更新时间:2023-02-02 22:28:44
这里是一种方法:
select t.*
from (select t.*,
count(*) over (partition by controlname, brandname, grouptypes) as cnt
from t
) t
where cnt = 1 or groupname <> 'Keine Zuordnung';
它使用窗口函数获取计数,然后使用where
进行逻辑计算.
It uses a window function to get the count and then a where
for your logic.