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

what is size of u r database?

0 Answers  


Give some information on report bursting and how to do it in bca as I have to split the report and send different reports to different people?

0 Answers  


SO many times i saw "$PM parser error " .what is meant by PM?

1 Answers  


i have two tables,table 1 having 2 columns and 3 rows,table2 having 3 columns and 2 rows.what is the output if i do left outerjoin,full outer join,right outer join?

2 Answers   IBM, Polaris,


what is data driven in informatica

5 Answers   IBM,






To achieve the session partition what r the necessary tasks u have to do?

1 Answers  


how lookup is acting as both active and passive ? how is it possitble?

9 Answers   TCS,


Hi, In Router transformation I created two groups . One is Passthrough=> True Second one is CorrectId’s => Invest>50000 Here I have one doubt. Can’t I treat default group as Passthrough group (fist group) . Is there any difference between default group and Passthrough group in this scenario? Let me know if you want more information about this scenario. Advance thanks.

3 Answers   IBM,


Session Recovery. 1000 rows in the source of which 500 passed through and then I killed the session. Can you perform a recovery and how

1 Answers   IBM,


I want skip first 5 rows to load in to target? what will be the logic at session level ??

1 Answers   IBM,


what is diffrence b/w joner and union transfermation

6 Answers  


Partition, what happens if the specified key range is shorter and longer

0 Answers   Cap Gemini,


Categories