List:General Discussion« Previous MessageNext Message »
From:Paul DuBois Date:February 8 2003 9:52pm
Subject:Re: Using SET in the INSERT statement
View as plain text  
At 11:37 +1000 2/7/03, boclair wrote:
>----- Original Message -----
>From: Paul DuBois <paul@stripped>
>To: boclair <boclair@stripped>; <mysql@stripped>
>Sent: Friday, February 07, 2003 8:47 AM
>Subject: Re: Using SET in the INSERT statement
>
>
>: At 14:19 +1000 2/5/03, boclair wrote:
>: >I notice some of my colleagues using SET in INSERT statements.
>: >
>: >DuBois makes a short reference on  p565, DoorStop1.
>:
>: The reference is short because there isn't much to say about it. :-)
>: The SET clause consists of col_name=value assignments, separated
>: by comma if there is more than one assignment.  That's all.
>:
>: Other examples are on pp 40-41 (Doorstop I) or p48 (Doorstop II).
>:
>I know this is so basic that I should understand, but in that case (p40)
>  INSERT INTO member SET last_name='Stein' ,first_name='Waldo';
>why not use that form always instead of (also p40)
>INSERT INTO member (last_name,first_name) VALUES('Stein' , 'Waldo');
>
>On the surface it seems a simpler syntax and is similar, in this
>respect, to the syntax for UPDATE.

Correct.

>
>I see that http://www.mysql.com/doc/en/INSERT.html provides that SET is
>an alternative to the VALUES syntax but the explanation that follows,
>apart from being a model of simplicity, only mentions the use of SET in
>relation to unique columns.

You can use it for any column.  Same applies for REPLACE.

>
>BTW, many thanks for your excellent book.  Invaluable (and it opens
>flat)

Thanks!

>
>Louise
Thread
Using SET in the INSERT statementboclair5 Feb
  • Re: Using SET in the INSERT statementKeith C. Ivey5 Feb
    • Re: Using SET in the INSERT statementboclair7 Feb
  • RE: Using SET in the INSERT statementJennifer Goodie5 Feb
    • Re: Using SET in the INSERT statementboclair7 Feb
  • Re: Using SET in the INSERT statementPaul DuBois6 Feb
  • Re: Using SET in the INSERT statementboclair7 Feb
    • Re: Using SET in the INSERT statementPaul DuBois8 Feb
  • request for unsubscribe ingoredAlex Shi10 Feb
  • Re: request for unsubscribe ingoredVan11 Feb