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 2005 Forums
 Transact-SQL (2005)
 select top

Author  Topic 

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2009-11-15 : 04:18:57

select top Id from registrants where userId = 2022


what is wrong with this?

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2009-11-15 : 05:39:44
found the problem - i have to do

select top 1
Go to Top of Page

liang.??
Starting Member

3 Posts

Posted - 2009-11-16 : 00:01:24
select top N [percent] [with ties] columns_list from [table]
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-11-16 : 02:20:28
quote:
Originally posted by esthera

found the problem - i have to do

select top 1


Top 1 without order by caluse is meaningless

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -