Liam Delahunty: Home Tips Design Web Words Links Contact

 

Panda Internet Security 2007 - $15 Discount Coupon
CoffeeCup Software
Download Free Web Design Software Here

Sponsors:

Think I deserve a present? See my Amazon Wish List


MySQL DISTINCT or GROUP BY


 
SELECT DISTINCT(email), newsletter FROM contact_tbl WHERE newsletter != 0;
1721 rows in set (0.42 sec)

 
SELECT email, newsletter FROM contact_tbl WHERE newsletter != 0 GROUP BY email;
1702 rows in set (0.42 sec)

DISTINCT will in the example above 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.

Share this!  



Mysql Day Of Year | Mysql Distinct Or Group By | Mysql Errno 145


 

  Tips | Home | Search | Contact

Link here: