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
Answer / ruchi
SELECT ID,COUNT(*) FROM TABLE1
GROUP BY ID
HAVING COUNT(*)>1
| Is This Answer Correct ? | 9 Yes | 0 No |
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 |
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 |
What is a code page in Informatica
3 Answers American Express, Cognizant, Deloitte,
What is difference between stored procedure transformation and external procedure transformation?
how to insert header after each group.
Please create a mapping where I have source which has one column with name like Aman_Gupta Rakesh_Mehra Sachin_More I want the target field should contain the name in reverse order i.e Gupta_Aman Mehra_Rakesh More_Sachin. Can you please tell me what transformation would be needed to do this.
How many cubes create from a single model?
When do you use mapping parameters? (In which transformations)
What is the difference between lookup override and souce qualifier override ?
How can we reset Sequence Generator, when we move objects from Dev Environment to QA env?
Explain transaction control transformation in informatica
I have 2 Sources,If 1st one Read sucessfully,Then only it has to move to read 2nd source.How can i do in INFORMATICA.
Tell me one complex query in oracle ?
Clarify the utilization of aggregator cache record?