Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to return distinct records

Status
Not open for further replies.

qlan

MIS
Feb 10, 2005
84
US
Hi,

Below is what I have for my Employees Table:

Name SSN Phone# ZipCode
Smith 123-45-8856 (817) 377-8825 76017
Mary 123-45-8857 (972) 422-1526 76015
Peter 123-45-8858 (972) 422-1528 76018
Paul 123-45-8859 (972) 422-1521 76017
Steve 123-45-8855 (972) 422-1522 76015
John 123-45-8860 (972) 422-1523 76018

I want to select everything from this table with distinct ZipCode. In this case, my query should return something like

Name SSN Phone# ZipCode
Smith 123-45-8856 (817) 377-8825 76017
Mary 123-45-8857 (972) 422-1526 76015
Peter 123-45-8858 (972) 422-1528 76018. How can I make this happen. Thanks so much!


 
Which row do you want to be returned? For example, you have 2 rows with a zip of 76017, which row based on that zip do you want to return?

JIm
 
It can be any row. one row with zipcode 76017, one with 76015 and one with 76018. Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top