MySQL||How many ways to get last row from a table?

Published: 04 September 2023
on channel: LearnSQLtoSSIS
127
2

1. LIMIT
SELECT * FROM emp ORDER BY ID DESC LIMIT 1;
2. Sub-Query
SELECT * FROM EMP WHERE id= (SELECT MAX(id) FROM emp);
3. Row_number()
SELECT * FROM
(SELECT *,ROW_NUMBER()OVER(ORDER BY ID DESC) as rn FROM EMP)AS Result
WHERE rn=1


On this page of the site you can watch the video online MySQL||How many ways to get last row from a table? with a duration of hours minute second in good quality, which was uploaded by the user LearnSQLtoSSIS 04 September 2023, share the link with friends and acquaintances, this video has already been watched 127 times on youtube and it was liked by 2 viewers. Enjoy your viewing!