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

What is a mapplet/worklet in informatica?

0 Answers  


when informatica 8 series released ?

1 Answers   IBM,


How do you migrate data from one environment to another?

0 Answers  


i have source as Column1 101 a 101 b 101 c so i want to load target as column1 ---> 101 abc

3 Answers   HP,


create a mapping to retrieve the employees who are getting salary greater than average salary?

4 Answers   TCS,


Enlist the various types of transformations.

0 Answers  


How do you implement unconn. Stored proc. In a mapping?

1 Answers  


How union transformation is used?

0 Answers  


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.

5 Answers   Amdocs,


checkout and checkin in informatica 8.6

3 Answers   TCS,


What are different types of transformations available in informatica?

0 Answers  


What are steps to follow Informatica migration from 7x to 8x? Pls Explain...

1 Answers   CTS, TCS,


Categories