Thread: Delete/Update with ORDER BY

Delete/Update with ORDER BY

From
Evandro Andersen
Date:
In Oracle you can use this:



DELETE FROM A WHERE A1 = 10 ORDER BY A2



There is something in the Postgresql ?



Evandro Andersen

Brazil

Postgresql 8.2





      Abra sua conta no Yahoo! Mail, o único sem limite de espaço para armazenamento!
http://br.mail.yahoo.com/

Re: Delete/Update with ORDER BY

From
"A. Kretschmer"
Date:
am  Thu, dem 25.10.2007, um  5:25:14 -0700 mailte Evandro Andersen folgendes:
> In Oracle you can use this:
>
>
>
> DELETE FROM A WHERE A1 = 10 ORDER BY A2
>
>
>
> There is something in the Postgresql ?

Can you explain this a little bit more? I can't see any sense. Either i
delete rows with A1=10 or not, but i don't need an order for this.


Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Re: Delete/Update with ORDER BY

From
"Roberts, Jon"
Date:
I have never seen order by in a delete statement in Oracle so I tested it.


SQL*Plus: Release 10.2.0.1.0 - Production on Thu Oct 25 07:45:50 2007

Copyright (c) 1982, 2005, Oracle.  All rights reserved.

SQL> connect / as sysdba
Connected.
SQL> create table a (a1 number, a2 number);

Table created.

SQL> delete from a where a1 = 10 order by a2;
delete from a where a1 = 10 order by a2
                            *
ERROR at line 1:
ORA-00933: SQL command not properly ended

Sure enough, it doesn't work.  What are you trying to do with an order by on
a delete?


Jon

-----Original Message-----
From: Evandro Andersen [mailto:evandro_andersen2000@yahoo.com.br]
Sent: Thursday, October 25, 2007 7:25 AM
To: pgsql-general@postgresql.org
Subject: [GENERAL] Delete/Update with ORDER BY

In Oracle you can use this:



DELETE FROM A WHERE A1 = 10 ORDER BY A2



There is something in the Postgresql ?



Evandro Andersen

Brazil

Postgresql 8.2





      Abra sua conta no Yahoo! Mail, o único sem limite de espaço para
armazenamento!
http://br.mail.yahoo.com/

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@postgresql.org so that your
       message can get through to the mailing list cleanly

Re: Delete/Update with ORDER BY

From
"A. Kretschmer"
Date:
am  Thu, dem 25.10.2007, um  5:25:14 -0700 mailte Evandro Andersen folgendes:
> In Oracle you can use this:
>
>
>
> DELETE FROM A WHERE A1 = 10 ORDER BY A2
>
>
>
> There is something in the Postgresql ?

Can you explain this a little bit more? I can't see any sense. Either i
delete rows with A1=10 or not, but i don't need an order for this.


Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings