Pascal
Pascal

Reputation: 2405

Oracle SQL developer selecting 10 rows

Hi quite new to oracle sorry for noob question but i cant find a way to fetch a few rows i am more of a mysql expert :P

SELECT * from aa.xxx  
OFFSET 10 ROWS 
FETCH NEXT 
10 ROWS ONLY ;

Here is the error in sql developer

ORA-00933: SQL command not properly ended 00933. 00000 - "SQL command not properly ended" *Cause:
*Action: Error at Line: 2 Column: 8

Upvotes: 0

Views: 811

Answers (2)

piyushj
piyushj

Reputation: 1552

OrderBy is missing

SELECT * from aa.xxx
ORDER BY XXXXXXX  
OFFSET 10 ROWS 
FETCH NEXT 10 ROWS ONLY ;

Upvotes: 0

oratom
oratom

Reputation: 291

use Metacolumn ROWNUM:

SELECT * FROM (
   SELECT ROWNUM recno, t.* 
     FROM RLFRJ.SP35_V_EMPORIUM  t
     ) 
 WHERE recno BETWEEN 10 AND 20

Upvotes: 0

Related Questions