Question

I can't seem to find, within the docs, a description of the syntax grammar they use throughout their site. This forces me into guessing, which for the most part works but others leaves me scratching my head.

Take this example. After reading the page I've come to the conclusion that the pipe '|' means OR, curley brackets {...} mean required and square brackets [...] mean optional. By that logic I could create a statement of INSERT my_table (foo) VALUE (DEFAULT) (notice the missing INTO) which doesn't seem right to me.

INSERT [LOW_PRIORITY | DELAYED | HIGH_PRIORITY] [IGNORE]
    [INTO] tbl_name
    [PARTITION (partition_name,...)] 
    [(col_name,...)]
    {VALUES | VALUE} ({expr | DEFAULT},...),(...),...
    [ ON DUPLICATE KEY UPDATE
      col_name=expr
        [, col_name=expr] ... ]

Am I correct in thinking INTO is optional? And does anybody know where MySQL keep their page describing the syntax language they use?

I don't have access to a SQL server at the moment, so I can't test it until later.

Was it helpful?

Solution

It actually exists in the docs, its called 1.2 Typographical and Syntax Conventions and can be found here https://dev.mysql.com/doc/refman/5.7/en/manual-conventions.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top