all groups > sql server (alternate) > september 2007 >
You're in the

sql server (alternate)

group:

a small SQL Puzzle


Re: a small SQL Puzzle Roy Harvey (SQL Server MVP)
9/26/2007 2:47:26 PM
sql server (alternate): Unless there are twins who are both the oldest this will do what you
ask.

SELECT *
FROM SomeTable as A
WHERE birthdate =
(SELECT MIN(birthdate)
FROM SomeTable as B
WHERE A.address = B.address)

Roy Harvey
Beacon Falls, CT

[quoted text, click to view]
a small SQL Puzzle Fiori
9/26/2007 8:37:12 PM
Hi,

Probable there is a simple solution for this, hopefully someone can
direct me in the right direction.

I have a table with a persons firstname, lastname, birthdate and
address. However, I want to select only one person per address, namely
the eldest of all persons living on the same address.

Can anyone provide me a solution?

Thanks in advance.
Re: a small SQL Puzzle Fiori
9/27/2007 8:06:42 AM
Thank you.

Roy Harvey (SQL Server MVP) schreef:
[quoted text, click to view]
AddThis Social Bookmark Button