write a sql query following table?
col1 col2
1 2
1 2
1 2
3 4
3 4
5 6
i want the output like

unique duplicate
col1 col2 col1 col2
1 2 1 2
3 4 1 2
5 6



write a sql query following table? col1 col2 1 2 1 2 1 2 3 4 3 4 5 6 ..

Answer / vaibhav jogale

We can achieve this using With clause
insert into TEST_UNIQ (col1,col2)
with Ct_Test as (
select col1,col2,row_number () over (partition by col1,col2 order by col1,col2)Rw_no
from test123)
select col1,col2 from Ct_Test where rw_no=1
/

insert into TEST_DUp (col1,col2)
with Ct_Test as (
select col1,col2,row_number () over (partition by col1,col2 order by col1,col2)Rw_no
from test123)
select col1,col2 from Ct_Test where rw_no>1
/

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More Informatica Interview Questions

Why can't we use few transformations in mapplet ? like xml and target defintions, seq etc ?

2 Answers   IBM,


What is deployment group?

0 Answers  


source is a flat file empname, empno, sal ram, 101, 1,000 sam, 102, 2,000 ques: my target needs the data to be loaded as sal -1000 and 2000 excluding commas target empname, empno, sal ram, 101, 1000 sam, 102, 2000 how to implement this?

5 Answers   Polaris,


explain abt union t/r?

1 Answers   IBM,


Hi, In a mapping I have 3 targets and one fixed width file as source. Total 193 records are there . I connected one port in aggregator to all 3 targets. The same value need to be load into these 3 targets . It is loaded like that only but in different order. Why? The order of insertion should be same know for all 3 targets ? Then why the order is changed ? Any one please help me. Advance thanks.

3 Answers   IBM,






What are different types of transformations available in informatica?

0 Answers  


What is synonym?

2 Answers   Patni,


How many input parameters can exist in an unconnected lookup?

0 Answers  


hi all my source looking like below column1 column2 101,102,103 abc,def,ghi 1001,1002,1003 a,b,c i want my target is column1 column1 101 abc 102 def 103 ghi 1001 a 1002 b 1003 c any one can you help

1 Answers  


Suppose we have a source qualifier transformation that populates two target tables. How do you ensure tgt2 is loaded after tgt1?

0 Answers  


Explain what are the different types of transformation available in informatica.

0 Answers  


How to load data in informatica ?

0 Answers  


Categories