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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

What does refresh system mean, and what are its distinctive choice?

562


Describe the scenarios where we go for joiner transformation instead of source qualifier transformation?

608


How to create the source and target database connections in server manager?

614


What is meant by active and passive transformation?

576


How do you manage the Parameter files while migrating your data from one environment to another environment?

532






As union transformation gives UNION ALL output, how you will get the UNION output?

637


have u done any performance tuning? how u ll do?

1849


What is domain and gateway node?

683


What happens when a session fails and you click on recover?

647


My source is delimited flat file Flat file data is H|Date D1|ravi|bangalore D2|raju|pune T|4 The data will be send to target if the fallowing two conditions satisfied 1.The first row Date column is equal to SYSDATE 2.Last record second port equal to number of records. How to achieve?

5554


what is mean by complex business rule ?

1712


How do you load first and last records into target table?

653


Explain pushdown optimization and types in informatica

657


What is InformaticaPowerCenter?

679


What is the session task and command task?

589