Subject Re: [firebird-support] Update database to new version?
Author Stevio
Hi all,

Does anyone know why Firebird 1.5 gives the error:
Dynamic SQL Error
SQL error code = -104
Invalid expression in the ORDER BY clause (not contained in either an
aggregate function or the GROUP BY clause)

This is the SQL. It works ok if you remove the order by, but I need the
order by.:

SELECT
B.REFERENCE_NUMBER AS REFERENCE_NUMBER,
B.ISBN AS ISBN,
B.TITLE AS TITLE,
B.YEAR_PUBLISHED,
B.EDITION,
B.COPY_NO,
B.FREQUENCY,
B.LAST_BORROWED,
B.LAST_RETURNED,
B.DATE_DUE_BACK,
B.AUTHOR_ID,
B.LOCATION_ID,
B.PUBLISHER_ID,
B.DEWEY_NO_ID,
B.IS_SHORT_LOAN
,A.NAME AS AUTHOR
FROM
BOOK B
,AUTHOR A
WHERE
B.IS_DELETED = 'F'

AND B.AUTHOR_ID = A.AUTHOR_ID
AND B.TITLE LIKE '%TEST%'
AND A.NAME LIKE '%TEST%'
ORDER BY
B.TITLE ASC,
A.NAME ASC

Thanks,
Stephen

----- Original Message -----
From: "Stevio" <redeagle@...>
To: "Firebird Support" <firebird-support@yahoogroups.com>
Sent: Monday, July 26, 2004 4:03 PM
Subject: Re: [firebird-support] Update database to new version?


> > > Error:
> > > The following error has occured:
> > > Dynamic SQL Error
> > > SQL error code = -104
> > > Invalid expression in the ORDER BY clause (not contained in either an
> > > aggregate function or the GROUP BY clause)
> > >
> > certainly could be - let's see the SQL which raises this exception.
> > Are you using the latest client library with your IIS server?
> > Alan
>
> Here is the SQL code. No error is returned if I remove the ORDER BY
clause.
>
> SELECT
> B.REFERENCE_NUMBER AS REFERENCE_NUMBER,
> B.ISBN AS ISBN,
> B.TITLE AS TITLE,
> B.YEAR_PUBLISHED,
> B.EDITION,
> B.COPY_NO,
> B.FREQUENCY,
> B.LAST_BORROWED,
> B.LAST_RETURNED,
> B.DATE_DUE_BACK,
> B.AUTHOR_ID,
> B.LOCATION_ID,
> B.PUBLISHER_ID,
> B.DEWEY_NO_ID,
> B.IS_SHORT_LOAN
> ,A.NAME AS AUTHOR
> FROM
> BOOK B
> ,AUTHOR A
> WHERE
> B.IS_DELETED = 'F'
>
> AND B.AUTHOR_ID = A.AUTHOR_ID
> AND B.TITLE LIKE '%TEST%'
> AND A.NAME LIKE '%TEST%'
> ORDER BY
> B.TITLE ASC,
> A.NAME ASC