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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to get this sql statement

Status
Not open for further replies.

dongdong

Programmer
Jun 17, 2002
1
CN
I have a table which has three columns.
name(varchar)
birthday(int)
location(varchar)

I want to get the oldest man's name in every 'location'

how to write the sql statement?

thanks
 
Do you have anything to handle the result? I would use this query:
Code:
SELECT * FROM table_name ORDER BY location, birthday;

I'd then loop through the result rows and print out the location, man's name, and birthday - every time the location changes.
 
6 hours later and still thinking, looks like temporary table time as no straight query seems to want to provide unique location results with the correct info. ***************************************
Party on, dudes!
[cannon]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top