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
 Transact-SQL (2000)
 select last record in the second table

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-02-24 : 08:21:00
didi writes "how can i select last record in the second table or select a record with the latest date"

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2004-02-24 : 09:33:55
Select the row where there does not exist another row in the same table that has a greater date.


select
column
from
table t
where
not exists (
select 1
from
table
where
t.date < date)

 


Jay White
{0}
Go to Top of Page
   

- Advertisement -