Subject Order by SubSelect and FetchWholeRows=false
Author guido.klapperich@t-online.de
Is it possible to use FetchWholeRows:=false and ordering by a SubSelect
together ?
I have the following Query:

select ACID,
ACUSID,
ACATID,
ACCSID,
ACCTID,
ACCAID,
ACPRID,
ACPJID,
(select USLASTNAME from USERS where
USID=ACTIVITIES.ACUSID) as USLASTNAME,
(select USFIRSTNAME from USERS where
USID=ACTIVITIES.ACUSID) as USFIRSTNAME,
(select USLASTNAME||', '||USFIRSTNAME from USERS where
USID=ACTIVITIES.ACUSID) as ACOWNER,
(select ATNAME from ACTIVITYTYPES where
ATID=ACTIVITIES.ACATID) as ATNAME,
(select CANAME from CAMPAIGNS where
CAID=ACTIVITIES.ACCAID) as CANAME,
(select PRNAME from PRIORITIES where
PRID=ACTIVITIES.ACPRID) as PRNAME,
(select CSDANAME1 from CUSTOMERS where
ACTIVITIES.ACCSID=CSID) as ACCSNAME,
(select CSDACITY from CUSTOMERS where
ACTIVITIES.ACCSID=CSID) as ACCSCITY,
(select CSDASTREET from CUSTOMERS where
ACTIVITIES.ACCSID=CSID) as CSDASTREET,
ACDATE,
ACFROM,
ACUNTIL,
ACDESCRIPTION,
ACCOMPLETED,
ACFIXED,
ACOVERDUE,
ACNOTPUBLIC,
ACREPORT from ACTIVITIES

One OrderingItem looks like
Activity Type=12; 12 DESC

When I set FetchWholeRows to false, open the Query and try to order by
the Activity Type, the SQL-Monitor shows
SELECT ACTIVITIES.ACID
from ACTIVITIES
ORDER BY 12 ASC

and I get an error. That's clear, because column 12 doesn't exist in the
Select-Statement.
Exists a workaround for the problem ?

Regards

Guido