
July 28th, 2007, 02:34 AM
|
|
Registered User
|
|
Join Date: Jul 2007
Posts: 1
Time spent in forums: 10 m 23 sec
Reputation Power: 0
|
|
|
SQL Query Help - Selecting the most recent record
Hi guys, thanks for taking a look.
I have two tables, let's say Name and Address. Name has the columns 'NameID' 'FirstName' and 'LastName'. Address has 'NameID' 'Line1' 'Line2' and 'LastConfirmed'.
What I want to do is
select FirstName,Lastname,Line1,Line2 from Name a
join Address b
on a.NameID = b.NameID
But I only want the most recent record in the Address table to be returned, based on something like 'order by LastConfirmed desc'. Any ideas how to do this?
Restrictions:
1. The table I am working with cannot be modified/columns added.
2. No additional permanent tables can be created.
Thanks!
|