Sql Query To Use a ' SELECT ' statement with LIMIT


To retrieve a certain topmost record out of the total record from the existing created table. Then we can use a ' SELECT ' statement with LIMIT.

Statement 1 will retrieve 3 topmost records out of the total record from the Employees table in the Employee DB Database.

Statement 2 will retrieve 2 topmost records out of the total record whose employee_id is greater than 150 from the Employees' table in the Employee DB Database

Enter - Select * from table_name;
SQL Query
SELECT 'Using limit without where condition -'; SELECT * FROM employees LIMIT 3; SELECT 'Using limit with where condition -'; SELECT * FROM employees WHERE employee_id>150 LIMIT 2;
Output