I'm trying to call the query:
UPDATE questions
SET 1 = 4
WHERE questionid = 4;
But I keep receiving an SQL syntax error. I have a column in my table called '1', and I want to set that columns value to the integer 4. I tried some other queries(below), but I still the same error.
UPDATE questions
SET '1' = 4
WHERE questionid = 4;
UPDATE questions
SET '1' = 4
WHERE 'questionid' = 4;
UPDATE questions
SET "1" = 4
WHERE questionid = 4;
UPDATE questions
SET "1" = 4
WHERE "questionid" = 4;
I'm trying to perform this query in java using the executeUpdate() method from the Statement java API.
I know some of you would advise me using a PerformedStatement rather than a regular Statement for building queries, and I will do, once I can figure out why my query isn't accepting that 1 is a column name and not an integer.
SET [1] = 4. On a side note, why would you ever name your column that?!