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

How i can upload the MainFrame source For Informatica ?

1 Answers  


In Lookup transformation a sql override should be done and disable the cache how do you do this procedure?

2 Answers   Wipro,


Suppose we are using a Dynamic Lookup in a Mapping and the commit Interval set for the tgt is 10000. Then how does the data get committed in the lookup if there were only 100 roows read from the src and the dynamic lookup dint have the 100th row in it?

3 Answers   Deloitte, TCS,


how to create a sample mapping for dynamic lookup transformation

2 Answers  


To provide support for Mainframes source data,which files r used as a COBOL files

1 Answers  


can we use bulk loading when we use look in mapping

1 Answers   TCS,


How to eliminate duplicate records in informatica mapping? Explain with an example....

1 Answers   Cap Gemini,


What is the internal processes of integration server in Informatica? How data will be extract and load to the target?

0 Answers   TCS,


Which transformation should we use to normalise the COBOL and relational sources?

0 Answers   Informatica,


How to eliminate duplicates from flat file..what is the procedure

4 Answers  


What are events in workflow manager?

1 Answers   Accenture, IBM,


i have 50500 records in my source.if wf run for the first time it will load 1000 records into 1 tgt,if runs second time it will load to another tgt.targets are FF and it is need to be created dynamically.how many tgt will be created and how?

1 Answers   HCL,


Categories