On Fri, 13 Sep 2002 14:10:25 +0200, Hanno Wiegard <[EMAIL PROTECTED]>
wrote:
>So the question for me is whether it is possible
>to use a table alias in a DELETE statement or not, e.g. 
>DELETE FROM foo f WHERE f.ID > 3000 (more complicated cases in reality 

Hanno, looks like you are out of luck here.

PG 7.3:
  DELETE FROM [ ONLY ] table [ WHERE condition ]

SQL92:
  DELETE FROM <table name> [ WHERE <search condition> ]

SQL99:
  DELETE FROM <target table> [ WHERE <search condition> ]
  <target table> ::= [ ONLY ] <left paren> <table name> <right paren>

which BTW makes "DELETE FROM mytable" invalid.  This would have to be
"DELETE FROM (mytable)".  Is there something wrong with my copy of the
standard?

There has been a discussion on -hackers about extensions to the DELETE
statement (DELETE [FROM] a FROM b, c WHERE ...).  If this gets
implemented in a future release, there's a certain chance for a table
alias.

>and I really need the alias because the SQL is generated automaically 
>by a tool)?

... and this tool works with what database?

Servus
 Manfred

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to