Sorry, I expressed evil The problem happens with the UPDATE An example of the error below:
CREATE TABLE teste ( coluna1 integer NOT NULL, CONSTRAINT chaveprimaria PRIMARY KEY (coluna1) ) WITHOUT OIDS; INSERT INTO teste(coluna1) VALUES (1); INSERT INTO teste(coluna1) VALUES (2); update teste set coluna1 = (coluna1 + 1) ERRO: duplicar chave viola a restrição de unicidade "chaveprimaria" SQL state: 23505 I can do in MySQL and Oracle update teste set coluna1 = (coluna1 + 1) ORDER BY COLUNA1 DESC Evandro Andersen Brazil 2007/10/25, Roberts, Jon <[EMAIL PROTECTED]>: > 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:[EMAIL PROTECTED] > Sent: Thursday, October 25, 2007 7:25 AM > To: [EMAIL PROTECTED] > 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/ _______________________________________________ pgbr-geral mailing list pgbr-geral@listas.postgresql.org.br https://listas.postgresql.org.br/cgi-bin/mailman/listinfo/pgbr-geral