Oracle uses the row range query to retrieve 4 to 10 rows and oracle10 rows.
Rownum cannot be used directly. aliases must be converted after query.
Take the EMP table as an example and take 4 to 10 rows:
Select * from (select rownum id, t. * from emp t) where id between 4 and 10;
If sorting is required, you must handle it as follows:
Select * from (select rownum rn, t. * from (select a. * from eba02 a order by eba003) t where rownum <= 110) where rn> = 110;
How does one query data that is not in a certain range in oracle?
You can use not in or not exist
Oracle queries corresponding data based on the selected time range
Select * from TableA where to_char (startDate, 'yyyy-MM-DD ')> = '2017-09-01' and to_char (endDate, 'yyyy-MM-DD ') <= '2017-09-012 ';
In addition, you can bind parameters in the program to avoid parsing SQL statements every time, which can reduce the query time.