How to Fetch Latest record/row from the Table in Oracle Database

preview_player
Показать описание
You will learn how to How to Fetch Latest record/row from the Table in Oracle Database.

Realtime Scenario:

This logic can be implemented to find whether the latest record should be inserted or updated to datawarehouse
Рекомендации по теме
Комментарии
Автор

Thank You so much you deserve more response from the public

chikujena
Автор

I found 100% suitable query
This is the perfect way for fetching latest records

Select * from (select e. *, row_number() over(order by rowid desc) rn from employees e) where rn=1

rajuuppula
Автор

Select top 1 * from employee order by hire_date <syntax for sql server>
Select * from employee where ROWNUM <= 1 order by hire_date desc <equivalent syntax for Oracle db>

crafty_girl_
Автор

Sir, I had applied this I have some rows with date from 01/04/2021 to 05/06/2021 and when use a query for fetching data rows for max date under the where clause, it returned rows of date 31/05/2021, why?

swetaawasthi
Автор

if three or four columns has same hiredate then how will fetch last inserted one

sathyas
Автор

SELECT * FROM tableName WHERE idNumber = ( SELECT MAX(idNumber) FROM tableName );


ideally, your id is a set to a seq populated by seq.nextval

リンゴ酢-bg
Автор

if date column was not there in the table .how to do

venugopald
Автор

Hi please help me to solve this
How to delete duplicate rows along with old timestamp and keeping latest timestamp unchanged for 100 ids. Please help me with it the delete condition

aahladtunesofnature
Автор

How do I get the first three records of a table, not just one?

Автор

if three or four columns has same hiredate then how will fetch last inserted one

sathyas