|
-
Sep 26th, 2003, 03:28 AM
#1
Thread Starter
Frenzied Member
MySQL Unique Records *RESOLVED*
I have a table (tbl_enquiries) with several fields including ID and email.
I want to return all the fields within the database but only for unique email addresses i.e. if there are two records with the same email field then only one will be returned - makes no difference which one.
Anyone help me with the SQL for this - I thought you could use DISTINCT but then I wasn't sure if a subquery would do it.
Cheers
DJ
Last edited by dj4uk; Sep 26th, 2003 at 10:20 AM.
-
Sep 26th, 2003, 10:20 AM
#2
Thread Starter
Frenzied Member
Ok if I use:
SELECT * FROM tbl_enquiries GROUP BY email
This returns one record for each email address. So thats what GROUP BY is for!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|