You will learn how to use ROWNUM in SQL in this video.
► ROWNUM clause is used to specify the number of records to return.
► Queries used in this video:
1. Display a table
SELECT * FROM hr.employees;
2. Display the first 7 rows only.
SELECT * FROM hr.employees WHERE ROWNUM ▶️7;
3. Display the first 5 rows only and sort by employee_id
SELECT * FROM hr.employees WHERE ROWNUM▶️5 ORDER BY employee_id;
4. Display the first 10 rows only and only the records with department_id = 90 sorted in an ascending order.
5. SELECT * FROM hr.employees WHERE ROWNUM▶️10 AND department_id=90 ORDER BY employee_id ASC;
6. To compare results of OR and AND operators:
SELECT * FROM hr.employees WHERE ROWNUM▶️10 OR department_id=90;
*** ▶️ means less than***
►This video is a part of SQL for Beginners Tutorial series.
► See the PLAYLIST to learn more about SQL commands: https://www.youtube.com/playlist?list=PLArhmGag-BWoPLN8vNw9fPlHPwAVvN-hG
👍👍 👍PLEASE LIKE & SHARE THIS VIDEO with your friends to support us grow!
🔔🔔 🔔DON'T FORGET TO SUBSCRIBE to watch future tutorials https://www.youtube.com/channel/UCMEzw1tTTLLssZSVNPA18aQ
TURN ON THE 🔔 BELL ICON TO GET UPDATES FIRST!📩📩📩
#rownumInSql #rownumInOracle