Martin Kersten
Martin Kersten

Reputation: 5513

SQL: INSERT + SET - Standard or MySQL specific?

I got used to the following INSERT standard possible with MySQL. Now I ask myself, if this is standard or is it MySQL specific. Can some practically verify if for example Oracle, JavaDB / Derby and of cause PostgreSQL can handle the INSERT statement this way:

INSERT INTO myTabe SET 'name' ='myName', number_of_children = 12;

This looks way better than insert values etc.

I often find only the INSERT INTO VALUES syntax so I am unsure if INSERT INTO SET syntax is standard conform beside I like it best.

Upvotes: 1

Views: 46

Answers (2)

klin
klin

Reputation: 121794

The syntax INSERT ... SET ... is specific for MySql and rather unknown in other RDBMS.

Upvotes: 1

Abhishek Sharma
Abhishek Sharma

Reputation: 6661

Use mysql update

update myTabe SET name ='myName', number_of_children = 12;

Upvotes: 0

Related Questions