Mysql

是 INSERT INTO … SET 標準 SQL 嗎?

  • July 2, 2018

我只是想知道這種語法是標準的還是來自哪裡?

例如

INSERT INTO gtest3 SET gDateTime='2017-07-16 01:00:00'

您可以在 MySQL中看到它的文件,但 PostgreSQL不支持它

顯然這是一個 MySQL 擴展,SQL 2011 規範將插入語法定義為,

<insert statement> ::=
INSERT INTO <insertion target> <insert columns and source>
14

<insertion target> ::=
<table name>

<insert columns and source> ::=
<from subquery>
| <from constructor>
| <from default>

<from subquery> ::=
[ <left paren> <insert column list> <right paren> ]
[ <override clause> ]
<query expression>

<from constructor> ::=
[ <left paren> <insert column list> <right paren> ]
[ <override clause> ]
<contextually typed table value constructor>

<override clause> ::=
OVERRIDING USER VALUE
| OVERRIDING SYSTEM VALUE

<from default> ::=
DEFAULT VALUES

<insert column list> ::=
<column name list>

你可以在 Pg Lists 上看到這個話題

引用自:https://dba.stackexchange.com/questions/182523