Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Iron Speed
Go Back   Dev Shed ForumsDatabasesOracle Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old April 29th, 2004, 02:35 PM
TyrantSilkey TyrantSilkey is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 6 TyrantSilkey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 31 m 51 sec
Reputation Power: 0
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.

Reply With Quote
  #2  
Old April 30th, 2004, 12:03 AM
TyrantSilkey TyrantSilkey is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 6 TyrantSilkey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 31 m 51 sec
Reputation Power: 0
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.

Reply With Quote
  #3  
Old April 30th, 2004, 12:49 PM
shafique shafique is offline
Senior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2003
Location: Canada
Posts: 305 shafique User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 45 m 20 sec
Reputation Power: 5
May be the following query is your required query but i am not for sure, see the attachement.
Attached Files
File Type: txt query3.txt (344 Bytes, 289 views)

Reply With Quote
  #4  
Old April 30th, 2004, 05:39 PM
TyrantSilkey TyrantSilkey is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Apr 2004
Posts: 6 TyrantSilkey User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 31 m 51 sec
Reputation Power: 0
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(*)).

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > displaying by highest count?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway