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
What is resilience time?
What do you mean incremental aggregation?
What are the various types of transformation?
What are the components of the workflow manager?
What is the use of an aggregator cache file?
What do you mean by DTM and Load manager and what is difference between load manager and load balancer?
Why union transformation is an active transformation?
How do you manage the Parameter files while migrating your data from one environment to another environment?
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
Differentiate between source qualifier and filter transformation?
What is a joiner transformation?
How to create or import flat file definition in to the warehouse designer?
Does an informatica transformation support only aggregate expressions?
What do you understand by SOA of Informatica?
Separate from an archive server and a powerhouse?