|
|
I am using the 'Customers' table of the Northwind database
DECLARE @CustomerID nchar(5)
SELECT TOP 1 @CustomerID = CustomerID
From Customers
Where Country = 'Germany'
ORDER BY CustomerID DESC
PRINT @CustomerID
Did you like this post?
|
|
|
||
|
|
|
|
|
|
|
subscribe via rss |
|
subscribe via e-mail |
|
|
print this post |
|
follow me on twitter |






comments
0 Responses to "USE TOP Operator and Store Results in a Variable using SQL Server"Post a Comment