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)
 sql top-- what's wrong with this?

Author  Topic 

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2008-07-27 : 03:56:21
select @mynewnumber=top 1 number from numbers

Incorrect syntax near the keyword 'top'.

what's the problem with this?

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-07-27 : 03:58:14
[code]select top 1 @mynewnumber = top 1 number from numbers order by number[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

esthera
Master Smack Fu Yak Hacker

1410 Posts

Posted - 2008-07-27 : 04:15:58
thanks :)
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2008-07-27 : 04:20:20
select @mynewnumber = MAX(number) from numbers
select @mynewnumber = Min(number) from numbers


E 12°55'05.25"
N 56°04'39.16"
Go to Top of Page
   

- Advertisement -