Hi Rainer,
Thank you for responding to my email. I have try what you suggested and it
works. The only issue with that is Oracle randomly selected # of rows to
return. The reason I need to put in that format is because I want this
scenario.
Let say I have 400 rows in a table, and I want to select those 400 row order by
customer name. Now, I want to return that 1st 100 in that order. Next, I want
to run the same query but this time I want it to return rows 101-200, then,
rows 201-300, and finally rows 301-400.
I think the only I can achieved this is by running the query below.
select * from (
select a.*, ROWNUM rnum from (
<select statemenet with order by clause> // I know how to write this query.
) a where rownum <= MAX_ROW
) where rnum >= MIN_ROW
Thank You,
Chieu Nguyen
[email protected]
From: Rainer Döbele [mailto:[email protected]]
Sent: Wednesday, June 18, 2014 3:01 AM
To: [email protected]
Subject: re: Building DBCommand
Hi Nhuyen,
this is Oracle Syntax and it is already implemented for the Oracle driver.
All you need to to is the following:
1. Make sure you are using de DBDatabaseDriverOracle.
2. Use cmd. limitRows(...) and cmd. skipRows(...)
then it should generate the desired statement for you.
There is no need to wrap the command inside another command.
Best regards
Rainer
Von: Nguyen, Chieu X [mailto:[email protected]]
Gesendet: Dienstag, 17. Juni 2014 22:43
An: [email protected]<mailto:[email protected]>
Betreff: Building DBCommand
Hi Rainer,
I was wondering how would I write the following SQL using EmpireDB.
select * from (
select a.*, ROWNUM rnum from (
<select statemenet with order by clause> // I know how to write this query.
) a where rownum <= MAX_ROW
) where rnum >= MIN_ROW
I would appreciate any suggestions.
Thank You,
Chieu Nguyen
[email protected]<mailto:[email protected]>