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)
 Is this optimized enough:

Author  Topic 

paomeow
Starting Member

5 Posts

Posted - 2005-01-11 : 22:21:43
Can anyone please advice me if this is optimized enough?
(Select Top 1 from Table1 where col1 = 12)
Union ALL
(Select Top 1 from Table1 where col1 = 13)

Thanks in advance.

paomeow
Starting Member

5 Posts

Posted - 2005-01-11 : 23:59:03
Also this doesn't seem to work because it didn't get the top most record with the date:
Select * from
(
Select Top 1 * from Table1 where col1 = 12
order by postdate
Union ALL
Select Top 1 * from Table1 where col1 = 13
order by postdate
)
Go to Top of Page

paomeow
Starting Member

5 Posts

Posted - 2005-01-12 : 00:14:55
solved the 2nd question by adding a select statement wrapped around individual queries....
Go to Top of Page
   

- Advertisement -