[Dbix-class] Oracle 9, distinct and rows/limit

Hartmaier Alexander Alexander.Hartmaier at t-systems.at
Mon Jan 15 16:01:36 GMT 2007


Not allowed in Oracle 10 too.

 =


-Alex

 =


  _____  =


From: Sam Crawley [mailto:sam_crawley at warpmail.net] =

Sent: Monday, January 15, 2007 3:44 PM
To: dbix-class at lists.rawmode.org
Subject: [Dbix-class] Oracle 9, distinct and rows/limit

 =


Hi,

I'm attempting to use distinct with a rows attribute on Oracle 9. DBIC is g=
enerating SQL looking something like this:

SELECT * FROM
(
    SELECT A.*, ROWNUM r FROM
    (
         SELECT myCol AS col1 FROM table =

           GROUP BY myCol AS col2
    ) A
    WHERE ROWNUM < 4
) B
WHERE r >=3D 1

However, this gets me the error message:

ORA-00907: missing right parenthesis

AFAIK, using 'as' in a GROUP BY expression is not valid Oracle 9 SQL (not s=
ure about 10). If I remove the 'as' in my SQL Console, the query executes s=
uccessfully. =


Is there any way around this?

Thanks.

*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*=
"*
T-Systems Austria GesmbH   Rennweg 97-99, 1030 Wien
Handelsgericht Wien, FN 79340b
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*=
"*
Notice: This e-mail contains information that is confidential and may be pr=
ivileged.
If you are not the intended recipient, please notify the sender and then de=
lete this e-mail immediately.
*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*=
"*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20070115/db5=
a145e/attachment-0001.htm


More information about the Dbix-class mailing list