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
What does refresh system mean, and what are its distinctive choice?
Describe the scenarios where we go for joiner transformation instead of source qualifier transformation?
How to create the source and target database connections in server manager?
What is meant by active and passive transformation?
How do you manage the Parameter files while migrating your data from one environment to another environment?
As union transformation gives UNION ALL output, how you will get the UNION output?
have u done any performance tuning? how u ll do?
What is domain and gateway node?
What happens when a session fails and you click on recover?
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?
what is mean by complex business rule ?
How do you load first and last records into target table?
Explain pushdown optimization and types in informatica
What is InformaticaPowerCenter?
What is the session task and command task?