Subject Ordering and subselects
Author Christian Gütter
Hi,

I have got the following query which includes subselects:

SELECT Nummer
, Kunde
, Mahntyp
, Dokument
, (SELECT FirFirmenname FROM T_Firmen
WHERE T_Firmen.Nummer = T_Mahnoptionen.Kunde) AS
COM_Kunde
, (SELECT DokumentName FROM T_Dokumentvorlagen
WHERE T_Dokumentvorlagen.Nummer = T_Mahnoptionen.Dokument) AS
COM_Dokument
FROM T_Mahnoptionen

The computed columns COM_Kunde and COM_Dokument are marked as computed
columns in the ColumnAttributes.
This query works so far. Then I tried to enable ordering for COM_Kunde
and COM_Dokument.

When I try to run this query, I get a "column unknown" error for
COM_Kunde.
Then I removed all OrderingItems and put an "ORDER BY COM_Kunde" in the
IB_Query.SQL. This resulted in the same "column unknown" error.

It seems to me that it is a limitation of Firebird that you can't order
by
a column which is computed by a subselect. Is this right? And is there
any
trick to work around it?

Thanks in advance for your answers.


Christian


PS: I am using IBO 4.2Hc and Firebird 1.0.