|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
||||
|
||||
|
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:
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!!!
__________________
My blog Tutorials about OSS databases, DBMonster ... Contribute to OSS Development, fill bug reports! Developer Shed eSupport Commented my.ini/my.cnf (ADD YOUR OWN CONFIG TRICK) An introduction to database normalization Natural or Surrogate key Custom ordering for your results Correlated and uncorrelated subqueries Don't turn your outer joins into inner joins Random data (with a bias) |
|
#3
|
|||
|
|||
|
Quote:
Thanks pablo, i finally figure out what went wrong. |
![]() |
| Viewing: Dev Shed Forums > Databases > Firebird SQL Development > Query error |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|