示例:
SELECT DISTINCT column1, column2
FROM table_name;
示例:
SELECT column1, column2
FROM table_name
GROUP BY column1, column2;
示例:
SELECT column1, column2
FROM (
SELECT column1, column2, ROW_NUMBER() OVER (PARTITION BY column1, column2 ORDER BY column1) AS rn
FROM table_name
) t
WHERE t.rn = 1;
通過(guò)以上方法,可以確保結(jié)果集中的數(shù)據(jù)是唯一的。