Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Join Condition problem

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-09-21 : 10:08:11
Venu writes "I am having two tables A and B. My join condition is based on 'ID' column of both the tables. In table B there is a column which will have some date values. For one 'ID' in table A, there will be many rows in table B for that matching 'ID'. But I want to get the only one matching 'ID' row from table B based on the latestdate. I tried like following but giving duplicate rows also

Select A.shipmentid, A.loaddate--, Shp.loaddate from A, B where A.shipmentid = B.shipmentid order by B.loaddate desc

Pls. help me out...."
   

- Advertisement -