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

lookup is passive y can't it be active? let us say i have some records in my source like 101,rohit,1000 101,rohit,1000 102,kumar,2000 like wise now as it is having multiple matches i return only first,last value it can't return bouth the values that means lookup is acting as select distinct right by default what means it is active?

5 Answers   IBM,


If source is having 5000 rows,and if you want to load data into 500 rows to target,if the session runs successfully,how can you verify the target if the rows are successfully loaded or not.

3 Answers   IBM, TCS,


How can u stop a batch?

2 Answers  


hi all, I have to do Informatica Certification? Can any body send me Some Informatica Certification Dumps/FAQS ? Advance Thanks...

0 Answers  


what is workflow varible

1 Answers   HP,


why cant we put a sequence generator or upd strategy transformation before joiner transformation?

2 Answers   Satyam,


What is the difference between Power Centre and Power Mart?

5 Answers   TCS,


How do you remove duplicate records in informatica? And how many ways are there to do it?

0 Answers  


Explain informatica architecture - version 8 / 9

0 Answers   Informatica,


Hello...... How can i set my mapping as read-only? Please answer me. Advance thanks

4 Answers  


Two Default User groups created in the repository are ____ and ______

2 Answers  


HOW TO GET THE LATEST DATA IN SCD ?

4 Answers   TCS,


Categories