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 |
if the column name in sql override is diff from the column name in source qualifier,what is the impact?
What is repository manager?
How to create different types of slowly changing dimensions (SCD) in informatica using the mapping wizard?
Plz..let me know differences between Informatica 7.1 and 8.1?
What are Dimensions and various types of Dimensions?
Which is the t/r that builts only single cache memory?
how the informatica server sorts the strings values in rank transformations?
What are the different types of Type2 dimension maping?
What is a joiner transformation?
How is Source Side push down optimization different to just providing a SQL override in Source qualifier transformation.
Two relational tables are connected to SQ Trans,what are the possible errors it will be thrown?
S1 is having 1 lakh records and s2 is having 100 records, s2 should compare s1 if emp no is same data should be updated if not their it should insert the data.what are the transformation used?