Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个包含电子邮件、名字和姓氏列的客户订单表。我想给所有购买过的人发电子邮件。我认为使用:
SELECT DISTINCT email, firstname, surname FROM ...
将努力返回所有唯一的电子邮件地址和名字和姓氏。
SELECT contact_email, firstname, surname FROM customer_details GROUP BY contact_email
哈哈,改用 GROUP BY :)