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



write a sql query following table some duplicate present 1 1 2 2 3 3 4 5 i want the out..

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

write a sql query following table some duplicate present 1 1 2 2 3 3 4 5 i want the out..

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

Post New Answer

More Informatica Interview Questions

Mapping variables, parameters syntax, if you create mapping variables and parameters in mapplet can you use them in the mapping?

1 Answers  


"Change cache" in Informatica ?

2 Answers  


Whats there in global repository

0 Answers  


Can I use same Persistent cache(X.Dat) for 2 sessions running parallely? If it is not possible why?If yes How?

0 Answers  


what is the difference between Informatica 7.1 and Abinitio?

1 Answers   TCS,






What is the function of union transformation?

0 Answers  


explain about session partitions ?

1 Answers  


why we need informatica

2 Answers   HCL,


Design a mapping to load a target table with the following values from the above source?

0 Answers   Informatica,


Explain what are the different versions of informatica?

0 Answers  


what r the transformations that r not involved in mapplet?

8 Answers   Wipro,


Why do we use DSS database for OLAP tools?

2 Answers  


Categories