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

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

update strategy transformation in informatica

1064


What are the components of the workflow manager?

1133


How to generate or load values in to the target table based on a column value using informatica etl tool.

1073


Explain joiner transformation in informatica

1124


How to load a Dimension ? and how to load a fact table?

1414


Explain the different lookup methods used in informatica?

1042


What is target designer and target load order?

1103


Explain what is informatica metadata and where is it stored?

1049


How to create the list file having millions of flat files while indirect loading in informatica? In indirect file loading, suppose we have less no.of flat files then we can enter files names manually in list file creation. If millions of files are there, how can we enter the flat file names in list file?

1975


Describe data concatenation?

1081


What is the cumulative sum and moving sum?

1186


What are the different types of repositories created using informatica?

1127


How to convert multiple rows to single row (multiple columns) in informatica

1378


Mention some types of transformation?

1044


What does reusable transformation mean?

1132