Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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



I am having a table with columns ID NAME 1 x a..

Answer / ruchi

SELECT ID,COUNT(*) FROM TABLE1
GROUP BY ID
HAVING COUNT(*)>1

Is This Answer Correct ?    9 Yes 0 No

I am having a table with columns ID NAME 1 x a..

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

I am having a table with columns ID NAME 1 x a..

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

Post New Answer

More Informatica Interview Questions

if the column name in sql override is diff from the column name in source qualifier,what is the impact?

5 Answers   TCS,


What is repository manager?

0 Answers  


How to create different types of slowly changing dimensions (SCD) in informatica using the mapping wizard?

0 Answers   Informatica,


Plz..let me know differences between Informatica 7.1 and 8.1?

3 Answers  


What are Dimensions and various types of Dimensions?

3 Answers   PayPal, TCS,


Which is the t/r that builts only single cache memory?

0 Answers  


how the informatica server sorts the strings values in rank transformations?

3 Answers   TCS,


What are the different types of Type2 dimension maping?

2 Answers   CTS,


What is a joiner transformation?

0 Answers  


How is Source Side push down optimization different to just providing a SQL override in Source qualifier transformation.

0 Answers  


Two relational tables are connected to SQ Trans,what are the possible errors it will be thrown?

2 Answers  


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?

5 Answers   TCS,


Categories