$ go run ./tools/parse --mode query "SELECT * EXCEPT (n) FROM (SELECT 1 AS n, "foo" AS s)"
2024/10/28 00:12:11 syntax error: :1:17: expected token: ALL, DISTINCT, but: (
1: SELECT * EXCEPT (n) FROM (SELECT 1 AS n, foo AS s)
$ go run ./tools/parse --mode query "SELECT * REPLACE (2 AS n) FROM (SELECT 1 AS n, "foo" AS s)"
2024/10/28 00:12:44 syntax error: :1:10: expected token: <eof>, but: <ident>
1: SELECT * REPLACE (2 AS n) FROM (SELECT 1 AS n, foo AS s)
^~~~~~~
Note:
Official syntax docs says AS is optional, but actually AS can't be omitted
spanner> SELECT * REPLACE (2 n) FROM (SELECT 1 AS n, "foo" AS s);
ERROR: spanner: code = "InvalidArgument", desc = "Syntax error: Expected keyword AS but got identifier \\\"n\\\" [at 1:21]\\nSELECT * REPLACE (2 n) FROM (SELECT 1 AS n, \\\"foo\\\" AS s)\\n ^"
EXCEPT
https://cloud.google.com/spanner/docs/reference/standard-sql/query-syntax#select_except
REPLACE
https://cloud.google.com/spanner/docs/reference/standard-sql/query-syntax#select_replace
Note:
Official syntax docs says
AS
is optional, but actuallyAS
can't be omitted