[MonetDB-users] Problem with colums named "begin" and "end"
Hi,
I have a table with columns named "begin" and "end". With SQLite and MySQL the SELECT works all right, but MonetDB cannot parse the SQL:
sql>CREATE TABLE "test" ("id" INT, "begin" TIMESTAMP, "end" TIMESTAMP); sql>INSERT INTO test ("id", "begin", "end") VALUES (0, '2003-02-07 12:00:00', '2003-02-07 12:00:00'); sql>SELECT id, begin end FROM test; !syntax error, unexpected BEGIN in: "select id, begin"
Kind regards, Markus
On 25-11-2007 22:00:10 +0100, Markus Gritsch wrote:
Hi,
I have a table with columns named "begin" and "end". With SQLite and MySQL the SELECT works all right, but MonetDB cannot parse the SQL:
sql>CREATE TABLE "test" ("id" INT, "begin" TIMESTAMP, "end" TIMESTAMP); sql>INSERT INTO test ("id", "begin", "end") VALUES (0, '2003-02-07 12:00:00', '2003-02-07 12:00:00'); sql>SELECT id, begin end FROM test; !syntax error, unexpected BEGIN in: "select id, begin"
quote identifiers with ", quote strings with '
select "id", "begin" "end" from "test";
On Nov 25, 2007 10:02 PM, Fabian Groffen Fabian.Groffen@cwi.nl wrote:
On 25-11-2007 22:00:10 +0100, Markus Gritsch wrote:
Hi,
I have a table with columns named "begin" and "end". With SQLite and MySQL the SELECT works all right, but MonetDB cannot parse the SQL:
sql>CREATE TABLE "test" ("id" INT, "begin" TIMESTAMP, "end" TIMESTAMP); sql>INSERT INTO test ("id", "begin", "end") VALUES (0, '2003-02-07 12:00:00', '2003-02-07 12:00:00'); sql>SELECT id, begin, end FROM test; !syntax error, unexpected BEGIN in: "select id, begin"
quote identifiers with ", quote strings with '
select "id", "begin", "end" from "test";
Ah, thank you :)
Markus,
SQL sandards require to double-quote identifiers that match SQL keywords; hence, try SELECT id, "begin", "end" FROM test;
Stefan
On Sun, Nov 25, 2007 at 10:00:10PM +0100, Markus Gritsch wrote:
Hi,
I have a table with columns named "begin" and "end". With SQLite and MySQL the SELECT works all right, but MonetDB cannot parse the SQL:
sql>CREATE TABLE "test" ("id" INT, "begin" TIMESTAMP, "end" TIMESTAMP); sql>INSERT INTO test ("id", "begin", "end") VALUES (0, '2003-02-07 12:00:00', '2003-02-07 12:00:00'); sql>SELECT id, begin end FROM test; !syntax error, unexpected BEGIN in: "select id, begin"
Kind regards, Markus
On Nov 25, 2007 10:03 PM, Stefan Manegold Stefan.Manegold@cwi.nl wrote:
Markus,
SQL sandards require to double-quote identifiers that match SQL keywords; hence, try SELECT id, "begin", "end" FROM test;
Thank you! Seems I was just misled by MySQL an SQLite ;)
participants (3)
-
Fabian Groffen
-
Markus Gritsch
-
Stefan Manegold