Oracle Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
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:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old July 13th, 2004, 12:07 AM
lameman lameman is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 1 lameman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Oracle GROUP BY equivalent to MySQL

I use this statement on a CGI script for a MySQL DB
"SELECT a.app_name, COUNT(*) AS counttimes, c.co_name, b.user_app_id, a.app_solution FROM isv_app a, isv_user b, isv c WHERE a.app_id=b.user_app_id AND a.app_co_id=c.isv_id group by b.user_app_id ORDER BY counttimes DESC" and it works fine, however, I use the same script but this time round is cater to work on an Oracle DB and somehow an error "ORA-00937 not a Single-Group group function" was generated. Can someone pls advise me how to solve this? I'm not an expert in Oracle, really need help here...

Reply With Quote
  #2  
Old July 13th, 2004, 10:12 AM
jim mcnamara jim mcnamara is offline
......@.........
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Jun 2004
Posts: 1,307 jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level)jim mcnamara User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 1 Week 3 Days 4 h 28 m 57 sec
Reputation Power: 48
First off, use code tags. If you don't know how read the FAQ.

As I read your SQL there is nothing wrong with it. Are you sure this statement is causing the 937 error?

Reason: 937 errors only happen when there is a
GROUP BY
clause, and you do not have one in that statement.

Reply With Quote
  #3  
Old July 15th, 2004, 10:35 PM
gamyers gamyers is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jul 2004
Posts: 14 gamyers User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Code:
SELECT a.app_name, COUNT(*) AS counttimes, c.co_name, b.user_app_id, a.app_solution 
FROM isv_app a, isv_user b, isv c 
WHERE a.app_id=b.user_app_id AND a.app_co_id=c.isv_id 
group by b.user_app_id 
ORDER BY counttimes DESC


You are not grouping by what you are selecting (ie a.app_name, c.co_name, b.user_app_id, a.app_solution).

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesOracle Development > Oracle GROUP BY equivalent tp MySQL


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 3 hosted by Hostway