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 mapplet/worklet in informatica?
when informatica 8 series released ?
How do you migrate data from one environment to another?
i have source as Column1 101 a 101 b 101 c so i want to load target as column1 ---> 101 abc
create a mapping to retrieve the employees who are getting salary greater than average salary?
Enlist the various types of transformations.
How do you implement unconn. Stored proc. In a mapping?
How union transformation is used?
My source is EmpID, Salary- (101, 1000)(102, 2000)(103, 3000). In the Target I want the following EmpID, Salary, Composite_Salary- (101, 1000, 1000)(102, 2000, 3000)(103, 3000, 6000). Please guide on how to build the mapping.
checkout and checkin in informatica 8.6
What are different types of transformations available in informatica?
What are steps to follow Informatica migration from 7x to 8x? Pls Explain...