且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

根据两列删除重复项

更新时间: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.