Forums Register Login

How to select resultset in range?

+Pie Number of slices to send: Send
Hi, I'm in a situation which I need to select rows from table in a range, let's say from record 3 to record 5. Is there any command in DB2 can do the job for me?
Thanks a lot and waiting for your reply..
+Pie Number of slices to send: Send
Can you explain a little more what you're trying to do? It seems a little odd that you need to select rows 3-5 in a table like that. Isn't there a specific field value(s) you can add to your WHERE clause to identify the records you need? Sorry, maybe I'm just misunderstanding you :roll:
+Pie Number of slices to send: Send
i've found the solution to my problem already.. thanks a lot..
+Pie Number of slices to send: Send
I know this thread is really old....
Does anyone have a solution on how to do this in DB2?
Select * from X where database returns only rows 21 through 30.
Thanks.
+Pie Number of slices to send: Send
I can't fully answer this, but I can send you in the right direction:
adding
"FETCH FIRST 40 ROWS ONLY"
to your SQL statement gets the first 40, but I don't think you can tell it to drop the first X amount.
+Pie Number of slices to send: Send
dbForums has a good thread on this. You can do it with a nested query, but it will be very inefficient.
them good ole boys were drinking whiskey and rye singin' this'll be the day that I die. Drink tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 977 times.
Similar Threads
Oracle Certification Query
Do we have policy like this?
Data layer design.
how to solve this insert record problem ?
Did not understand the answer(John Meyers's mock exam)
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 02:34:17.