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 |
Plz can any one say me how to get the informatica certification materials and dumps
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 ?
What is the capacity of power cube?
Why the workflow is failed after running two hours in informatica?
IF Sorce table contains CLOB as its one data type then i get error at the target table. How can this be resolve?
How to view and Generate Metadata Reports?
what is informatica metadata?
what is parameter file?
what are the transformations that are used in data cleansing ? and how data cleansing takes place ?
how to duplicates from expression transformation without using sorter before that
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