Dear friends, Mysql engine support LIMIT in SQL sintax, this way i can return a range of rows. How can i do this with SQL server ? Thank's [^o)]
Dear Friends, LIMIT in Mysql doesn't work like TOP, because TOP only gime rows from the start or table. LIMIT have two parameters and it work like a range. For example SELECT .... LIMIT 3,6 This way i have a range of rows between 3 and 6 row. This kind of solution is what i need to build. Thank's
[quote user="carrascojg"] Dear Friends, LIMIT in Mysql doesn't work like TOP, because TOP only gime rows from the start or table. LIMIT have two parameters and it work like a range. For example SELECT .... LIMIT 3,6 This way i have a range of rows between 3 and 6 row. This kind of solution is what i need to build. Thank's [/quote] Search for Pagination
[quote user="carrascojg"] Dear Friends, LIMIT in Mysql doesn't work like TOP, because TOP only gime rows from the start or table. LIMIT have two parameters and it work like a range. For example SELECT .... LIMIT 3,6 This way i have a range of rows between 3 and 6 row. This kind of solution is what i need to build. [/quote] No, TOP doesn't give rows from the start of a table. At least that is not guaranteed all the time. That's why you need an ORDER BY to control which rows to return. In that case my first reply is valid. Have y look at ROW_NUMBER(), if you're on SQL Server 2005.
That's right, but the perfomance is a little low. Yes, i have right index. But if you compare perfomance between TOP solution and ROW_NUMBER() solution, the execution plan tell me the true. Thanks'