| 1 | <h2>Comments</h2> |
| 2 | <pre><code># Single line comment |
| 3 | -- Single line comment |
| 4 | // Single line comment |
| 5 | /* Multi-line |
| 6 | comment */</code></pre> |
| 7 | |
| 8 | <h2>Strings</h2> |
| 9 | <pre><code>"foo \"bar\" baz" |
| 10 | 'foo \'bar\' baz' |
| 11 | "Multi-line strings |
| 12 | are supported" |
| 13 | 'Multi-line strings |
| 14 | are supported'</code></pre> |
| 15 | |
| 16 | <h2>Variables</h2> |
| 17 | <pre><code>SET @variable = 1; |
| 18 | SET @$_ = 2; |
| 19 | SET @"quoted-variable" = 3; |
| 20 | SET @'quoted-variable' = 3; |
| 21 | SET @`quoted-variable` = 3;</code></pre> |
| 22 | |
| 23 | <h2>Operators</h2> |
| 24 | <pre><code>SELECT 1 && 1; |
| 25 | SELECT 1 OR NULL; |
| 26 | SELECT 5 & 2*3; |
| 27 | SELECT 2 BETWEEN 1 AND 3;</code></pre> |
| 28 | |
| 29 | <h2>Functions and keywords</h2> |
| 30 | <pre><code>SELECT COUNT(*) AS cpt, MAX(t.pos) AS max_pos |
| 31 | FROM `my_table` |
| 32 | LEFT JOIN `other_table` AS t |
| 33 | WHERE `somecol` IS NOT NULL |
| 34 | ORDER BY t.other_col DESC</code></pre> |