Monday, October 27, 2014

Can SELECT TOP have argument?

Try this:



DECLARE @Counter as int
SET @Counter = 5
SELECT TOP (@Counter) * FROM Table1 ORDER BY ID DESC


No comments:

Post a Comment