GeekInterview.com
  I am new, Sign me up!
 
GeekInterview.com  >  Interview Questions  >  Data Warehousing  >  Informatica
Go To First  |  Previous Question  |  Next Question 
 Informatica  |  Question 493 of 644    Print  
write a query to retrieve the latest records from the table sorted by version(scd).

  
Total Answers and Comments: 5 Last Update: February 09, 2008     Asked by: ravi214u 
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
February 27, 2007 06:05:37   #1  
sunil        

RE: write a query to retrieve the latest records from ...
you can write a query like inline view clause you can compare previous version to new highest version then you can get your result
 
Is this answer useful? Yes | No
March 01, 2007 07:36:00   #2  
sanghala Member Since: April 2006   Contribution: 112    

RE: write a query to retrieve the latest records from ...
hi Sunil

Can u please expalin your answer some what in detail ????

 
Is this answer useful? Yes | No
March 01, 2007 23:03:06   #3  
Hanu Ch Rao        

RE: write a query to retrieve the latest records from ...

Hi



Assume if you put the surrogate key in target (Dept table) like p_key and
version field dno field and loc field is there

then


select a.p_key a.dno a.loc a.version from t_dept a

where a.version (select max(b.version) from t_dept b where a.dno b.dno)



this is the query if you write in lookup it retrieves latest (max)
version in lookup from target. in this way performance increases.


 
Is this answer useful? Yes | No
February 09, 2008 12:42:04   #4  
ketannp Member Since: February 2008   Contribution: 1    

RE: write a query to retrieve the latest records from the table sorted by version(scd).
Select Acct.* Rank() Over ( partition by ch_key_id order by version desc) as Rank
from Acct
where Rank() 1

 
Is this answer useful? Yes | No
February 09, 2008 15:50:11   #5  
dl_mstr Member Since: November 2007   Contribution: 26    

RE: write a query to retrieve the latest records from the table sorted by version(scd).
select business_key max(version) from tablename group by business_key
 
Is this answer useful? Yes | No


 
Go To Top


 Sponsored Links

 
About Us -  Privacy Policy -  Terms and Conditions -  Contact -  Ask Question -  Propose Category -  Site Updates 

Copyright © 2005 - 2009 GeekInterview.com. All Rights Reserved

Page copy protected against web site content infringement by Copyscape