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.
Author |
Topic |
simondeutsch
Aged Yak Warrior
547 Posts |
Posted - 2010-06-30 : 14:11:24
|
What's the correct syntax to feed two TOP values into 2 variables?Like so:DECLARE @Var1 CHAR(10),@Var2 SMALLMONEYSELECT @Var1 = TOP 1 Code, @Var2 = PaymentAmount FROM TableName WHERE RowID = 100 |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
tkizer
Almighty SQL Goddess
38200 Posts |
|
simondeutsch
Aged Yak Warrior
547 Posts |
Posted - 2010-06-30 : 14:58:07
|
Thanks!No, I want TOP, not MAX. Like, return the first row matching x, not necessarily the latest or the greatest. |
 |
|
X002548
Not Just a Number
15586 Posts |
|
|
|
|