I get this error at this code:
SELECT "LastUpdate" ;
FROM "xx_yy";
Is LastUpdate a reserved word ?
I tried to change " " to `` or delete them, I don't really know the perfect combination to make it work. I'm beginner in this.
I get this error at this code:
SELECT "LastUpdate" ;
FROM "xx_yy";
Is LastUpdate a reserved word ?
I tried to change " " to `` or delete them, I don't really know the perfect combination to make it work. I'm beginner in this.
Get rid of the quotes around your column identifier and tablename. That makes them strings instead of identifiers. Either use ticks or nothing at all. Also, ditch the semi-colon after the first line as it is terminating your query before it reaches the FROM
clause.
SELECT `LastUpdate`
FROM `xx_yy`;
or
SELECT LastUpdate
FROM xx_yy;
Remove the first semicolon.
SELECT FOO FROM BAR
The above is all one statement.
A semicolon (;
) signifies the end of a statement. So you actually have two separate, distinct statements:
SELECT "LastUpdate"
FROM xx_yy
The second statement is not valid, which is why you are seeing the error.
Solution: Remove the semicolon at the end of the first line:
SELECT "LastUpdate"
FROM "xx_yy";
Also note if the ANSI_QUOTES
sqlmode is not enabled, MySQL treats double-quotes as string literals (the same as single quotes). You may need to change these to the MySQL-specific backtick, or remove them entirely:
SELECT `LastUpdate`
FROM `xx_yy`;
Most likely your query should look like
SELECT "LastUpdate" FROM "xx_yy";
; is marking an end of a query.