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

Sam Crawley sam_crawley at warpmail.net
Tue Jan 16 09:05:42 GMT 2007


Is this a bug then?

On 15/01/07, Hartmaier Alexander <Alexander.Hartmaier at t-systems.at> wrote:
>
>  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
> generating 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
> sure about 10). If I remove the 'as' in my SQL Console, the query executes
> successfully.
>
> 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
> privileged.
> If you are not the intended recipient, please notify the sender and then
> delete this e-mail immediately.
>
> *"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*"*=
"*"*
>
> _______________________________________________
> List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
> Wiki: http://dbix-class.shadowcatsystems.co.uk/
> IRC: irc.perl.org#dbix-class
> SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
> Searchable Archive:
> http://www.mail-archive.com/dbix-class@lists.rawmode.org/
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/dbix-class/attachments/20070116/3a4=
00736/attachment.htm


More information about the Dbix-class mailing list