ShootingBlanks Posted July 25, 2008 Share Posted July 25, 2008 Hello. I know that if I wanted, say, records 6-10 of a query in MySQL I'd just tack on "LIMIT 5,5" to the end of my query. But what about in SQL? Is that possible?... I know to get the first, say, 15 records you'd say "SELECT TOP(15)" but I don't know how to select a certain number of records starting from in the middle of the recordset... Thanks!... Quote Link to comment Share on other sites More sharing options...
ShootingBlanks Posted July 25, 2008 Author Share Posted July 25, 2008 Nevermind! - found a solution here, in case anyone's interested. It worked great for me: http://www.tech-recipes.com/rx/1868/mimic_the_mysql_limit_feature_in_microsoft_sql_server Quote Link to comment Share on other sites More sharing options...
Barand Posted July 25, 2008 Share Posted July 25, 2008 Another way to get rows 20-29 with MS-SQL is SELECT TOP 10 * FROM mytable WHERE id NOT IN (SELECT TOP 20 id FROM mytable) Quote Link to comment Share on other sites More sharing options...
fenway Posted July 26, 2008 Share Posted July 26, 2008 I've actually used that one, Barand... couldn't believe it had to be so "forced". Quote Link to comment Share on other sites More sharing options...
Barand Posted July 26, 2008 Share Posted July 26, 2008 Hard to believe how a RDBMS with so much money behind it can have so little functionality. Compare it's handful of datetime functions with MySQL's, for example Quote Link to comment Share on other sites More sharing options...
fenway Posted July 28, 2008 Share Posted July 28, 2008 Compare it's handful of datetime functions with MySQL's, for example No kidding... I nearly threw up trying to figure out the equivalent of DATE(myDateTimeField)... all those "magic" numbers and CASTing.... ugh. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.