April 21, 2010 at 1:07 pm
I need a sql as "select * from mytable rownum >=10 and rownum <= 20;
Does ms sql support above sql, if not, how to solve the problem.
Thanks
April 21, 2010 at 1:18 pm
moongeegee (4/21/2010)
I need a sql as "select * from mytable rownum >=10 and rownum <= 20;Does ms sql support above sql, if not, how to solve the problem.
Thanks
select * from mytable where rownum between 10 and 20
/* ----------------------------- */
Tochter aus Elysium, Wir betreten feuertrunken, Himmlische, dein Heiligtum!
April 21, 2010 at 1:21 pm
Is rownum a declared column in your table?
April 21, 2010 at 1:32 pm
April 22, 2010 at 6:02 am
I think the rownum is not the part of the table.
OP have to clear this. Otherwise the query is very simple.
April 23, 2010 at 2:40 am
select * from mytable where rownum >=10 and rownum <= 20
The above query is fine only when rownum is a column in your table or you will need to to use the analytical function
ROW_NUMBER() OVER(order by ) as rownum
in your select list to get the row number.
[font="Times New Roman"]Anil Kubireddi[/font]
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply