View Single Post
  #1 (permalink)  
Old 02-02-2008, 04:10 PM
RayForster RayForster is offline
Junior Member
 
Join Date: Feb 2008
Posts: 1
RayForster is on a distinguished road
Default ANY dialect question:

Select Query with different fields


Hello All...

I'm sure this is very simple to those who know... but I'm trying to do what I think should be a simple query, but I'm struggling to get exactly what I want...

Suppose I have a table similar to the below:

Table:
email - firstname - lastname
mrx@mycompany.com - Fred - Bloggs
mrx@mycompany.com - F - Bloggs
mrx@mycompany.com - Fred - Blogs
me@here.com - Pam - Smith
me@here.com - Pamela - Smith
you@there.com - Tom - Thumb

All I want to do is return / query that returns one value for each entry as follows:
mrx@mycompany.com - Fred - Bloggs
me@here.com - Pam - Smith
you@there.com - Tom - Thumb

I've used the DISTINCT keywork, but because the other fields are unique, all rows are returned still....

Similarly, If I wanted to query all records in the table that have multiple records for an email address in the table above, how would I do that?

Many thanks in advance....
Reply With Quote

ANSWER(S):