about query with order by question
Posted in 2006
Topics: General Discussion
Hi,
I have the following query working in several databases:
select fingerprint
from CertificateData
wherestatus=?
and issuerDN=?
ORDER BY expireDate DESC
but it refuses to work on Informix since the attribute expireDate in
the order by clause is not in the select list (exact error message is:
ORDER BY column (expiredate) must be in SELECT list)
Since this form of select query with the order by clause is allowed in
many DBMS like MySQL, Oracle, MS SQL Server and Sybase, I wonder if
there are some configuration flag or something that allow Informix to
accept this (popular?) query syntax.
Any help will be appreciated.
Regards,
Gabriel
belingueres@gmail.com said:
>
> Hi,
>
> I have the following query working in several databases:
>
> select fingerprint
> from CertificateData
> where> status=?
> and issuerDN=?
> ORDER BY expireDate DESC
>
> but it refuses to work on Informix since the attribute expireDate in
> the order by clause is not in the select list (exact error message is:
> ORDER BY column (expiredate) must be in SELECT list)
>
> Since this form of select query with the order by clause is allowed in
> many DBMS like MySQL, Oracle, MS SQL Server and Sybase, I wonder if
> there are some configuration flag or something that allow Informix to
> accept this (popular?) query syntax.
export UPGRADE_IDS_VERSION=10.0
--
Bye now,
Obnoxio
"C'est pas parce qu'on n'a rien ' dire qu'il faut fermer sa gueule"
- Coluche
did i mention i like nulls? heck, i even go so far as to say that all
columns in a table except the primary key could/should be nullable. this
has certain advantages, for example, if you need to insert a child record
and you don't have a parent row for it, just do an insert into the parent
table with the primary key value (everything else null), and voila,
relational integrity is preserved. but this is, admittedly, a bit
controversial among modellers.
--r937, dbforums.com