Firebird SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesFirebird SQL 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:
  #1  
Old January 31st, 2007, 05:37 AM
reynaldio reynaldio is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Posts: 2 reynaldio User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 57 m 54 sec
Reputation Power: 0
Query error

hi, i have this query problem.

SELECT A.ID,B.NAME ACCTYPE_NAME, B.ACC_CLASS,SUM(C.DEBIT) SDEBIT, SUM(C.CREDIT) SCREDIT
FROM (ACC_ACCOUNT A INNER JOIN ACC_ACCOUNT_TYPE B
ON A.ACCTYPE_ID= B.ID) LEFT JOIN ACC_TRANSACTIONDT C ON A.ID=C.ACCOUNT_ID
GROUP BY A.ID

can anyone figure out what is wrong with this query? this query works just fine in mysql but raise error in firebird 1.5.

any comment would be highly appreciated

Reply With Quote
  #2  
Old January 31st, 2007, 11:22 AM
pabloj's Avatar
pabloj pabloj is online now
Modding: Oracle MsSQL Firebird
Dev Shed God 7th Plane (8000 - 8499 posts)
 
Join Date: Jun 2001
Location: Outside US
Posts: 8,073 pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level)pabloj User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 2 Months 4 Weeks 4 h 20 m 18 sec
Reputation Power: 281
As in any other database (other than MySQL) you'll have to put all non aggregate columns selected in the group by clause also.
Note that you should also post the exact error message as the usual
Quote:
... but raise error ...
means nothing.

There is a note in the mysql manual stating that not including all non aggregate columns in the group by might lead to unpredictable results!!!

Reply With Quote
  #3  
Old January 31st, 2007, 12:34 PM
reynaldio reynaldio is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Posts: 2 reynaldio User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 57 m 54 sec
Reputation Power: 0
Quote:
Originally Posted by pabloj
As in any other database (other than MySQL) you'll have to put all non aggregate columns selected in the group by clause also.
Note that you should also post the exact error message as the usual means nothing.

There is a note in the mysql manual stating that not including all non aggregate columns in the group by might lead to unpredictable results!!!




Thanks pablo, i finally figure out what went wrong.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesFirebird SQL Development > Query error


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

 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

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





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway
Stay green...Green IT