write s sql query following table some duplicate present i
want unique one column duplicate another column display?

name id
a 1
a 1
b 2
b 2
c 3
i want the required output like
unique duplicate
name id name id
a 1 a 1
b 2 b 2
c 3

Answer Posted / senthil

select a.nameid as unique_name_id,b.nameid as DUplicate_name_id
from
(select distinct nameid from name) a
left outer join
(select nameid from name group by nameid having count(*) > 1) b
on a.nameid = b.nameid

Output:
---------
unique_name_id Duplicate_name_id
a 1 a 1
b 2 b 2
c 3

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Some flat files are there, out of these having some duplicate. How do you eliminate duplicate files while loading into targets?

1322


Explain how to import oracle sequence into informatica?

590


Give some information on report bursting and how to do it in bca as I have to split the report and send different reports to different people?

555


lookup transformation with screenshots

3559


In how many ways we can create ports?

701






When do you use sql override in a lookup transformation?

589


Write the unconnected lookup syntax and how to return more than one column.

595


What is the use of transformation?

576


What is informatica?

680


design of staging area?

1589


What are the different transaction levels available in transaction control transformation?

675


without table how to come first record only in oracle?

1854


what kind of issue you will get in environment? (we ll call help desk to raise ticket rite?

1623


How do you update the records with or without using update strategy?

664


What do you mean by channel change?

543