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

In which transformation you cannot drag ports into it?

0 Answers   Informatica,


How to generate the HTML output using Informatica.

3 Answers   Wipro,


I have table name in that I have Rajesh Reshika Priya I want the result Like only Starting with R Rajesh Reshika Can someone help me to get these results and How?

3 Answers  


Hi Experts, I have a source table like this. Name Number Raj 2 Ram 1 Sam 2 John 1 In the target I need the ouptput like the below Raj Raj Ram Sam Sam John We dont know the number value . It will be changing as n.. Please help me regarding this. Thanks, Nataraj V

2 Answers   NTT Data,


write sql query following table quarter sales q1 1000 q1 2000 q1 3000 q1 4000 q2 5000 q2 6000 q2 7000 q2 8000 q3 1000 q3 2000 q3 3000 q3 4000 q4 5000 q4 6000 q4 7000 q4 8000 i want the output format like q1 q2 q3 q4 1000 5000 1000 5000 2000 6000 2000 6000 3000 7000 3000 7000 4000 8000 4000 8000

5 Answers   CTS,


Performance wise which is better joiner or look up ? Give me with example?

1 Answers   CGI,


Insert else update option in which situation we will use

4 Answers   HCL,


Hi, source data is col1 values are 5,6,7 col2 are 3,2,1 col3 are 8,9,10 and i want to get target as col1 5,6,7 col2 1,2,3 col3 8,9,10 how to do this one?

6 Answers  


What is a command that used to run a batch?

4 Answers  


Aggregator transformation is having fields say a,b,c,d,e group by is enabled on a,b,c with sorted input,How the aggregator transformation process the i/p data?or in which way i/p comes to agg transformation

1 Answers   TCS,


where to store informatica rejected data? How to extract the informatica rejected data?

0 Answers  


where to select code page option?

2 Answers   TCS,


Categories