write a sql query following table some duplicate present
1
1
2
2
3
3
4
5
i want the output unique one column duplicate another
column following format like
unique duplicate
1 1
2 2
3 3
4
5
Answers were Sorted based on User's Feedback
Answer / babu
Hi,
SELECT DISTINCT(DEPTNO) UNIQ,E.DUP FROM EMP
LEFT OUTER JOIN
(SELECT DEPTNO DUP FROM EMP GROUP BY DEPTNO HAVING COUNT
(DEPTNO)>1) E
ON (EMP.DEPTNO=E.DUP)
please correct me if any thing wrong.
Thanks,
Babu
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / nagarau puppala
select distinct country_id "unique", (case when count(country_id) > 1 then country_id else null end) "duplicate" from s_region
group by country_id order by duplicate;
| Is This Answer Correct ? | 3 Yes | 4 No |
difference between shortcut and reusable transformation?
Explain pushdown optimization and types in informatica
how will u get 1 and 3rd and 5th records in table what is the query in oracle please help me
What is a difference between complete, stop and abort?
What do you understand by term role-playing dimension?
in reporting we add some new objects,how we get the count of the newly added objects to the report
In ur current projectu have done any performance tuning of mappings?
How can we trouble shoot the commas in a column of a comma delimited flat file in Informatica
How to load data into 3 target tables which are in different schema but with the same name and same relational connection at infromatica level ? How to differentiate while loading ? and how to load ?
what is worklet and what use of worklet and in which situation we can use it?
Explain the mapping variable usage example in informatica
write a query for how to eliminate the duplicate rows without using distinct?