Friday, March 23, 2012

I want to select all rows between 10 and 20 .......

I want to select all rows between 10 and 20 from a
view

how can I do this?

which database are you using?

Oracle has rownum or something i'm not sure about name which you can use directly.

but you need to justify the criteria for records to be return. does your table/view contain ID field, if yes then think of situation say where my 15th record is deleted?

in general what i would do is create a temporary with required columns and 1 identity column. then i'll insert records in this table.

after inserting i'll simple run query like select fields from temp_table where id in @.num1 and @.num2.

thanks,

satish.

|||

is it ok?

(MS SQL)

SELECT ProductID, ProductName FROM Products WHERE UnitsInStock BETWEEN '0' AND '35'
this example is from MSDN
hope it helps thanks
|||

if you are asking about MS SQL

I think it may be

select *

from a

where rows between '10' and '20'

thanks and hope it helpsAngel

No comments:

Post a Comment