📜  sql server 按不同列选择行 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:35.656000             🧑  作者: Mango

代码示例1
SELECT a.*
FROM emails a
INNER JOIN 
  (SELECT email,
    MIN(id) as id
  FROM emails 
  GROUP BY email 
) AS b
  ON a.email = b.email 
  AND a.id = b.id;