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

What is informatica? Why do we need it?

743


What is the different lookup cache(s)?

712


Does an informatica transformation support only aggregate expressions?

699


Explain lookup transformation source types in informatica

785


Explain sessions?

681






Where can we find the throughput option in informatica?

701


Can we get 1st record through Informatica(without sequence number).

1084


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

3620


How might one distinguish in the case of mapping is right or not without associating session?

733


What is mapping debugger?

658


How to generate sequence numbers?

710


How we can create indexes after completing the loan process?

838


Suppose we do not group by on any ports of the aggregator what will be the output?

683


Define enterprise data warehousing?

742


How do you migrate data from one environment to another?

729