By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,574 Members | 1,968 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,574 IT Pros & Developers. It's quick & easy.

The LIMITations of ms-sql. Equivalent to MySql's LIMIT

P: 55
I know there are ways to do this, but I can't seem to get it to work. This is basically my sql code which does work, I just can't get it to return a section of records.

Any suggestions?

Expand|Select|Wrap|Line Numbers
  1. SELECT [tbl1].[ProdNum], [tbl1].[QtyOnHand], [tbl2].[ProductClass], [tbl3].[pCode], ROW_NUMBER() OVER(ORDER BY ProductClass) [rowNumber]
  2.  FROM [tbl1] 
  3. JOIN tbl2 ON [tbl2].[ProdNum] = [tbl1].[ProdNum] JOIN tbl3 ON ( [tbl3].[pCode] = '2') AND [tbl3].[ProdNum] = [tbl1].[ProdNum]
  4.  WHERE ((LOWER([tbl1].[ProdNum]) LIKE '%integra%' OR LOWER([tbl2].[Description]) LIKE '%integra%' ) ) AND [tbl1].[Warehouse] = '1' AND [tbl1].[Warehouse] = '1'
Aug 21 '09 #1
Share this Question
Share on Google+
2 Replies

Expert 2.5K+
P: 2,878
What error are you getting?

--- CK
Aug 22 '09 #2

P: 55
I'm not getting an error. The statement I posted executes fine. I'm just not sure how to get it to return only records 10-25 for example.
Aug 22 '09 #3

Post your reply

Sign in to post your reply or Sign up for a free account.