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

inner join

Status
Not open for further replies.

overDeveloper

Programmer
Dec 11, 2006
58
US
I there a way to order a table you are joping with? The problem is I have atable that I need to join with that could return multiple records on the join, I want to only return the latest entry (by a date field). Is this possible?
 
yes, it certainly is possible

give some specific details and you may get a more comprehensive answer :)

r937.com | rudy.ca
 
ummm... ok, say I have the following tables

Table1
id
1
2
3
4

Table2
id tbl1ID date content
1 2 04/09/70 aaaa
2 2 04/05/70 bbbb


I need a join that is going to give me either just id 2 in table2 or at l;east ordered so that id 2 will be first... make sense?
 
There are probably several ways to do this.

First, you'll need a query on table 2 that will return the max date for each tbl1ID. Do you know how to write this query? Give it a shot and post the query back here once you have that part figured out.



-George

Strong and bitter words indicate a weak cause. - Fortune cookie wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top