write s sql query following table some duplicate present i
want unique one column duplicate another column display?

name id
a 1
a 1
b 2
b 2
c 3
i want the required output like
unique duplicate
name id name id
a 1 a 1
b 2 b 2
c 3

Answers were Sorted based on User's Feedback



write s sql query following table some duplicate present i want unique one column duplicate anoth..

Answer / ram pothineni

1) In SQ.. override the default query as below..

SELECT NAME,ID,ROW_NUM()OVER(PARTITION BY NAME ORDER BY
NAME)RN FROM TABLE_NAME

2) In router create two groups

UniqueGroup - RN = 1
DuplicateGroup - RN > 1

3) Connect Respective group to respective targets...



-- Ram Pothineni

Is This Answer Correct ?    5 Yes 2 No

write s sql query following table some duplicate present i want unique one column duplicate anoth..

Answer / anto

unique

select distinct name,id from table

duplicate

select name,id from table
group by name,id
having count(name||id) > 1

Is This Answer Correct ?    2 Yes 0 No

write s sql query following table some duplicate present i want unique one column duplicate anoth..

Answer / chandan023

1.Sort the data 
2.Expression transformation
   a)create a variable1(integer) and var2(string)
   b) var2 = concatenate all fields
   b)  set the value of the variable to 1 if (concat all fields are = var2)
   c) create a o/p port = var2
-- output of the expression t/f will be like
   NAME ID NEW_COL
   a  1 0
   a  1 1
   b  1 0
   b  1 1
   c  1 0
 3. Use a router transformation and route the data based on the new thirt column.

Happy ETLing :)

Is This Answer Correct ?    0 Yes 0 No

write s sql query following table some duplicate present i want unique one column duplicate anoth..

Answer / senthil

select a.nameid as unique_name_id,b.nameid as DUplicate_name_id
from
(select distinct nameid from name) a
left outer join
(select nameid from name group by nameid having count(*) > 1) b
on a.nameid = b.nameid

Output:
---------
unique_name_id Duplicate_name_id
a 1 a 1
b 2 b 2
c 3

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Informatica Interview Questions

Explain what are the different versions of informatica?

0 Answers  


What are the challenges you have faced in your project?

1 Answers   Cognizant, Infosys,


What is an expression transformation?

0 Answers  


Hi experts ,I have a Source of 1000 records.I have to load 100 records in first target,101 to 200 records in 2nd target, 201 to 300 records in 3rd target and again 301 to 400 in first target like that as cyclick process. How can i acheive this.

5 Answers   DELL, TCS,


what is mapping override?

2 Answers   Cap Gemini,






can we use cartesian join in informatica

3 Answers   IBM,


how can u connect client to ur informatica sever iff server is located at different place( not local to the client)

3 Answers   Accenture,


In which scenario did u used Mapping variable?

1 Answers   Cognizant,


On which transformations you created partitions in your project?

0 Answers   Cap Gemini,


how may sources can be used in a mapping at a time?(limit)

6 Answers   IBM,


What is decode in informatica?

0 Answers  


What is the role of informatica in project ?Like i showed financial projects?

1 Answers   Amdocs,


Categories