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

How the informatica server sorts the string values in Rank transformation?

1 Answers   Informatica,


Hi, Can you please send me the Informatica 8 certification exam dumps to my email id rwork.san@gmail.com Thanks, Revathi.

6 Answers   CTS,


What are the different options available for update strategy?

0 Answers  


How to load the source table into flat file target(with columns) in informatica?

4 Answers   Accenture,


Why do you use Mapping Parameter and mapping variable?

0 Answers  






following scenario i have 1000 record flatfile source i want ist row to ist target 2nd eow to 2nd target 3rd row to 3rd target how will u do?

7 Answers   Polaris,


HOW TO PROCESS THE ROWS FROM JOINER AND EXPRESSION TRANSFORAMTION TO SORTER TRANSFORMATION

0 Answers  


my source is like this id,name sal 10 abc 1000,10 pqr 2000, 10 xyz 3000 ,10 jkl 4000 and my requirement is like this 10 abc,pqr,xyz,jkl 2000 .... i have try for this by using expression transformatin its ok of the concatenation of second column but the thing is that on third column if u group by using agg t/r the last value will com i.e 4000 but i asked by a interviewer that i dont want the first or last column i want the middle column i.e 2000 .plz reply for the same

2 Answers   KPIT,


we have three columns and two rows. col1 col2 col3 a b c want to change into 2 columns and 3 rows ,how? col1 a col2 b col3 c which transformation u'll use and how?

3 Answers   Cognizant,


What is lookup change?

0 Answers  


I have a flat file, want to reverse the contents of the flat file

0 Answers   Informatica,


What are the hard ware required for a normal sized data warehouse? and What are the software required for a normal kind of data warehouse?

2 Answers   CTS,


Categories