[sql]根据多个字段去重

来源:互联网 发布:linux 禅道下载地址 编辑:程序博客网 时间:2024/04/30 11:37

从网上找了好久找到的,mark

select * from t1 a where not exists (select 1 from t1 where a.p=p and a.q=q and a.id<id)
0 0