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

Suppose we have two source qualifier transformations sq1 and sq2 connected to target tables tgt1 and tgt2 respectively. How do you ensure tgt2 is loaded after tgt1?

0 Answers  


in which situations do u go for sequence generator ?

2 Answers   TCS,


what is threshold error in informatica?

1 Answers   TCS, Wipro,


What is data caches/ index caches?

0 Answers  


There are n numbers of flatfile of exactly same format are placed in a folder .Can we load these flatfile's data one by one to a single relational table by a single session??

9 Answers   TCS,


What are Rapid changing dimensions?

1 Answers  


can you avoid static cache in the lookup transformation? I mean can you

1 Answers  


What are the differences between source qualifier and joiner transformation?

0 Answers  


what are types of dimentions?

3 Answers  


What is metadata reporter?

1 Answers   Informatica,


I have source table 100 records after run session successfully but loads the target table 50 records only what happened that 50 records and how can i load remaining 50 records

5 Answers   Patni,


what is lookup chache?

1 Answers   Patni,


Categories