Write a query to retrieve latest records from the target table means if we have used scd2 version type of dimension, than retrieve the record with highest version no.for eg verno id loc 1 100 bang 2 100 kol 1 101 bang 2 101 chenwe have to retrieve 100/kol and 101/chen. how it is possible through query.

Questions by ravi214u   answers by ravi214u

Showing Answers 1 - 6 of 6 Answers

Ranganath Nagaraj

  • Feb 12th, 2007

answer is here for your question:1. Get the distict value and put order by desc for version Id.. you can get the latest record..

  Was this answer useful?  Yes


  • Feb 14th, 2007

hi solution is here. hi ranganath ,u r answer is wrong,it will give latest of all employee records.but the question is ,latest record of each employee.for this ,this is d answerselect x.* from tablewname x where rowid in (select max(rowid) from tablename group by empno );i hope this will be the exact answer.

  Was this answer useful?  Yes

Rvinder Ravula

  • Apr 3rd, 2007

Dear Friend

select * from table_name where rowid in (select max(rowid) from table_name groupby verno);

U try this one...

Ravinder Ravula

  Was this answer useful?  Yes


  • Mar 2nd, 2018

What if the we have
Your query will retun 2,3 and we will get
2,101,Kol as output

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.


Related Answered Questions


Related Open Questions