Hi
i am using c# as my language & sql server as my database ..
My question is there is no key ward called

limit

in sqlserver....how i solve this type of question...

the example is --->
the sql server data table has 25 rows & i want to retrieve 6 to 11 data rows...How i write sql code in sql server to get that rows

thank U

Recommended Answers

All 4 Replies

Through a quick search i found this, that might help you :)

LIMIT Syntax

thanks for reply answer for my question...buy not solve that
I use sqlserver 2005...when i use sql code as

SELECT * FROM `student` LIMIT 20, 10

there is a error occur...in that error message box show Unable to parse query text...The quary cannit be representer int the diagram and Criteria Pane
What am i do ???
Please help me

SELECT * FROM
(
SELECT row_number() OVER (ORDER BY AnyColumn) AS rownum, Column1,Column2, ..., ColumnX
FROM   YourTable) AS A
WHERE A.rownum BETWEEN 10 AND 20

Ionut

Thanks Ionelul
Your SQL is 100% correct... Thanks Lots :D

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.