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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What is resilience time?

651


What do you mean incremental aggregation?

621


What are the various types of transformation?

640


What are the components of the workflow manager?

635


What is the use of an aggregator cache file?

683






What do you mean by DTM and Load manager and what is difference between load manager and load balancer?

633


Why union transformation is an active transformation?

651


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

540


suppose in my source flatfile i have 10000 records in that some of master table records missed table records missed then what will u do

1730


Differentiate between source qualifier and filter transformation?

996


What is a joiner transformation?

549


How to create or import flat file definition in to the warehouse designer?

609


Does an informatica transformation support only aggregate expressions?

604


What do you understand by SOA of Informatica?

583


Separate from an archive server and a powerhouse?

491