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

in which situations do u go for sequence generator ?

2 Answers   TCS,


How You Pull the records on daily basis into your ETL Server.

2 Answers   TCS,


how can i invoke pmcmd in command line prompt

1 Answers  


What is the expected value if the column in an aggregator transform is neither a group by nor an aggregate expression?

1 Answers  


What is critical mapping?

2 Answers  






can you use flat file for lookup table?why?

2 Answers   HCL,


There are 4 source files which contains same metadata create target that should display the file name along with record please send answer with mapping

3 Answers   Wipro,


List the transformation in informatica.

1 Answers   TCS,


Give one example for each of conditional aggregation, non-aggregate expression, and nested aggregation?

0 Answers  


How to load last 10 records of flat file in to the target?

5 Answers   iNautix,


What is dimensional table? Explain the different dimensions.

0 Answers  


what is mapping override?

2 Answers   Cap Gemini,


Categories