Return to Snippet

Revision: 10106
at December 8, 2008 11:39 by flatearthcomms


Initial Code
SELECT DISTINCT(email), newsletter FROM contact_tbl WHERE newsletter != 0;

SELECT email, newsletter FROM contact_tbl WHERE newsletter != 0 GROUP BY email;

Initial URL


Initial Description
DISTINCT will produce more results if a user had been added with more than one type of newsletter. The GROUP BY clause will just get the single email.

Initial Title
Selecting only one occurrence from a column

Initial Tags


Initial Language
SQL