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

explain abt union t/r?

1 Answers   IBM,


I have 10 columns in a flat file and 10 rows corresponding to that columns. I want column number 5 and 6 for last five records. In unix as well as informtica.

0 Answers   CTS,


what is casual dimension?

6 Answers   IBM,


What r the type of indexes u generally used in informatica?

2 Answers   Keane India Ltd,


How do you avoid duplicate records with out using source qualifier,expression,aggrigator,sorter and lookup transformations ?

4 Answers   IBM,






How do you manage the Parameter files while migrating your data from one environment to another environment?

0 Answers  


Explain constraint based loading in informatica

0 Answers   Informatica,


What is the difference between normal and bulk loading? Which one is recommended?

1 Answers  


On which transformations you created partitions in your project?

0 Answers   Cap Gemini,


SRC1 -> EXP -> AGGR -> TGT SRC2 -> EXP -> Above is a maaping with two pipeline connected to the taret TGT. Design wise is this design is correct or not ?

6 Answers   IBM,


which is better perfomancewise lookup or joiner and why?can anyone give example?

6 Answers   TCS,


What are the guidelines to be followed while using union transformation?

0 Answers   Informatica,


Categories