create table tb_distinct_ex(
pid int,
cid int,
dt int,
logt int
);
INSERT INTO tb_distinct_ex(pid,cid,dt,logt)
values(1,1,1,1),(1,1,2,1);
SELECT * from tb_distinct_ex;
SELECT DISTINCT pid,cid,logt FROM tb_distinct_ex
SELECT DISTINCT pid,cid,logt FROM tb_distinct_ex
unique pid, cid, logt
指定了unique联合字段 pid, cid, logt
pid, cid, logt 完全一样就是重复