I am having a table with columns
ID NAME
1 x and the requirement is to get the o/p like this
1 y ID Count(*)
1 z 1 3
2 a 2 2
2 b
3 c
so write a sql query to get the id n how many times its
count of repetition n there u shouldn't get the distinct(i.e
id-3)

Reply as early as possible

Answers were Sorted based on User's Feedback



I am having a table with columns ID NAME 1 x a..

Answer / ruchi

SELECT ID,COUNT(*) FROM TABLE1
GROUP BY ID
HAVING COUNT(*)>1

Is This Answer Correct ?    9 Yes 0 No

I am having a table with columns ID NAME 1 x a..

Answer / sambu

select id,count(*) from <table name>
group by id having count(*)>1;

The above gives us desired output

Is This Answer Correct ?    8 Yes 0 No

I am having a table with columns ID NAME 1 x a..

Answer / akash khanwalkar

This one is without using HAVING clause:

SELECT TEMP.ID, TEMP.ID_COUNT FROM
(
SELECT ID AS ID, COUNT(ID) AS ID_COUNT FROM TEMP_ID_TABLE
GROUP BY ID
) TEMP
WHERE TEMP.ID_COUNT > 1;

Is This Answer Correct ?    2 Yes 0 No

Post New Answer

More Informatica Interview Questions

Plz can any one say me how to get the informatica certification materials and dumps

0 Answers   TCS,


what is the size ur source like(file system or database)? how many record daily come u r banking project?

0 Answers   Cognizant, Flextronics,


How can i catch the Duplicate Rows From SorterTrans in a Seperate Target Table ?

2 Answers  


What is the capacity of power cube?

1 Answers  


Why the workflow is failed after running two hours in informatica?

1 Answers   GE,






IF Sorce table contains CLOB as its one data type then i get error at the target table. How can this be resolve?

2 Answers  


How to view and Generate Metadata Reports?

1 Answers  


what is informatica metadata?

0 Answers  


what is parameter file?

1 Answers   Cap Gemini,


what are the transformations that are used in data cleansing ? and how data cleansing takes place ?

3 Answers  


how to duplicates from expression transformation without using sorter before that

1 Answers  


i have a source table ID NAME SAL 101 A 1000 102 B 2000 103 C 1500 target load should be ID NAME SAL 101 A 1000 101 B 2000 101 C 1500 102 A 1000 102 B 2000 102 C 1500 103 A 1000 103 B 2000 103 C 1500

3 Answers   TCS,


Categories