1. 程式人生 > >查詢表中 A/B 字段聯合是否唯一

查詢表中 A/B 字段聯合是否唯一

count from column sel code sele lec group by col

  • SELECT column_a,column_b,COUNT(*) as num FROM TABLE GROUP BY column_a,column_b;

  • SELECT column_a,column_b,COUNT(*) as num FROM TABLE group by column_a,column_b having count(*)>1;
  • 查詢表中 A/B 字段聯合是否唯一