If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > selecting distinct rows amongst composite values

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-18-05, 06:26
newimmigrant newimmigrant is offline
Registered User
 
Join Date: Feb 2005
Posts: 8
selecting distinct rows amongst composite values

So i have an addressbook table which has the following fields
srNo, Name, Address, City, State, Zip, Phone

A number of entries have been entered more than once. the pr key is srNo.

So there is an entry #1 having the values
Person1, Address1,City1,State1,Zip1,Phone1

There is another entry at #10 having values
Person1, Address1,City1,State1,Zip1,Phone1

So how do I pull up distinct rows which checks across ALL fields such that the row above comes up only once?

thank you
Reply With Quote
  #2 (permalink)  
Old 10-18-05, 06:36
tombell tombell is offline
Registered User
 
Join Date: Jun 2005
Posts: 23
Code:
SELECT 
 Name,
 Address,
 City,
 State,
 Zip,
 Phone
FROM
 table
GROUP BY
Name,
 Address,
 City,
 State,
 Zip,
 Phone
Reply With Quote
  #3 (permalink)  
Old 10-18-05, 13:19
newimmigrant newimmigrant is offline
Registered User
 
Join Date: Feb 2005
Posts: 8
thank you.

thanks a lot. that worked
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On