I have a sql select:
SELECT employee.name, employee.surname, department.name FROM employee INNER JOIN deparment
ON employee.id_department=department.id WHERE department.name = 'security'
But I wanna select only 5 records. If I can do this using the SQL tools?
And If I wana select >= 5 records (more than 5 records)?
Here is the SQL
SELECT employee.name, employee.surname, department.name
FROM employee INNER JOIN deparment
ON employee.id_department=department.id
WHERE department.name = 'security'
LIMIT 5;
To know more about LIMIT
I believe >= 5 records means leaving first 5 records and get another 5.
SELECT employee.name, employee.surname, department.name
FROM employee INNER JOIN deparment
ON employee.id_department=department.id
WHERE department.name = 'security'
LIMIT 5,5;
SELECT employee.name, employee.surname, department.name FROM employee INNER JOIN deparment
ON employee.id_department=department.id WHERE department.name = 'security'
limit 5;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With