List:Internals« Previous MessageNext Message »
From:Michael Widenius Date:November 28 2001 1:06am
Subject:suggestion regarding syntax for DELETE
View as plain text  

>>>>> "Michael" == Michael McClennen <michaelm@stripped> writes:

Michael> I would encourage the developers of MySQL to consider modifying the
Michael> syntax for multi-table deletes, while 4.0 is still in the alpha stage
Michael> (and the interface is still, presumably, somewhat mutable).

Michael> The problem is that the two forms of DELETE engender confusion about
Michael> which tables are actually being deleted from.  In the single-table
Michael> version, the table being affected comes after the keyword FROM.  In
Michael> the multi-table version, the ones affected are those that come _before_
Michael> the FROM.  I believe that this will likely cause confusion, and is
Michael> generally inconsistent and ugly.

Michael> Here is my suggestion:

Michael> DELETE FROM table_name [WHERE...]

Michael> DELETE FROM table_name [table_name]* USING table_name [table_name*]
> [WHERE...]

Michael> In both cases, the tables from which deletions occur are those
Michael> immediately following the FROM keyword.  Any that appear after the
Michael> keyword USING are not modified.

I agree with that your syntax is cleaner.

One problem is however that we took the current syntax from Access and
it's always nice to use a syntax that others are familiar with,
instead of inventing a new syntax...

Sinisa, I assume it would be easy to make the above the suggested
multi-table syntax but still support the Access like syntax ?

suggestion regarding syntax for DELETEMichael McClennen27 Nov
  • suggestion regarding syntax for DELETEMichael Widenius28 Nov
    • Re: suggestion regarding syntax for DELETESinisa Milivojevic28 Nov