Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL error while using limit keyword in Derby

Tags:

sql

derby

I have used limit keyword as:

"select * from empl3 limit "+4

But I am getting the error as:

Syntax error: Encountered "4" at line 1, column 27.

I am using Derby database.

like image 466
kushagra Avatar asked Feb 07 '23 05:02

kushagra


1 Answers

As documented in the manual there is no LIMIT clause in Derby.

Derby uses the SQL standard for limiting the number of rows:

select * 
from empl3 
fetch first 4 rows only;
like image 144
a_horse_with_no_name Avatar answered Feb 08 '23 19:02

a_horse_with_no_name