|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here! |
|
#1
|
|||
|
|||
|
displaying by highest count?
Deleted Original post, the second example is easier and would teach me what I need to know.
Last edited by TyrantSilkey : April 30th, 2004 at 07:28 AM. |
|
#2
|
|||
|
|||
|
Well if it would make it easier I'll give a simpler example that I could adapt. Given the entitys Team, TypeHit and Runs with team having a name and TeamId and TypeHit having 4 different types of hits and HitId, and Runs with a TeamId and HitId for every individual hit, how would I display the Type of hit with the highest count for each team along with the team name?
Team(Name, TeamId) TypeHit(HomeRun, Single, Double, Triple, HitId) Runs(TeamId, HitId) Team TypeHit Count Brewers HomeRun 5 Brewers Single 55 Brewers Double 32 Brewers Triple 14 Braves HomeRun 8 Braves Single 67 Braves Double 72 Braves Triple 17 So the answer would look like: Team TypeHit Count Brewers Single 55 Braves Double 72 Last edited by TyrantSilkey : April 30th, 2004 at 07:27 AM. |
|
#3
|
|||
|
|||
|
May be the following query is your required query but i am not for sure, see the attachement.
|
|
#4
|
|||
|
|||
|
Thanks for the help, I was able to adapt it to what I was doing perfectly. I kept trying to add the imbeded select count up at the first line with the other select instead of adding it to the having statement like your code does when I was trying to figure it out on my own, which was giving me problems calling Max(Count(*)).
|
![]() |
| Viewing: Dev Shed Forums > Databases > Oracle Development > displaying by highest count? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|