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

I have three same source structure tables. But, I want to load into single target table. How do I do this? Explain in detail through mapping flow.

774


What is aggregator transformation in informatica?

545


Hi, In source I have records like this No name address 10 manoj mum 10 manoj dilhi 20 kumar usa 20 kumar Tokyo I want records in target like shown below No name addr1 addr2 10 manoj mum dilhi 20 kumar usa Tokyo If it is reverse we can do this by using Normalizer transformation by setting occurance as 2. Somebody will say use denoralization technique. But as of my knowledge I couldn’t find any denormalization technique. Is there any concept like that? I tryid this seriously but I could find any idea to implement this. Can any one please help me ? Advance Thanks

6389


can any one give some examples for pre sql and post sql(Except dropping and creating index).

3515


I have done MBA in 2008. i got job as business analyst in 2008 january through consultany. but after 3 months they are giving training Informatica developer. now iam continuing this job. my question is when iam going to interview HR people ask me many times like this " YOU ARE MBA GRADUATE. HOW YOU ARE SELECT THIS POSTION. IAM EXPLAINING WHAT I HAVE MENTION ABOVE". PLEASE TELL HOW IAM TELLING THIS QUESTION ANSWER.

1631






Different qualification between a related rotate toward the sky and isolates look upward?

556


How do you load first and last records into target table?

669


whats the logic to load the lower level of granularity of data to fact table.

1807


what is size of u r database?

1852


How to Create a folder using pmrep command?

626


Can u generate reports in Informatica?

658


Does an informatica transformation support only aggregate expressions?

609


How can we create index after completion of load process?

600


i had a source containing business,sales,details column and i have to load it to a target but i have some bad records in it , but i have to load 70% of business records and 50% of sales and 95% of details records excluding bad records to achieve this what should be done and what all logic and tx should be used can anyone help? thanks in advance

1679


What is an aggregator transformation?

617