So I made a table with columns “from” and “to”.
While writing to the table is fine because I am inserting one value into each column (and not referencing the columns by name), but whenever I want to retrieve data (SELECT), I want to retrieve… say, only the “from” column.
Except as you guessed, it interprets “from” as an SQL command instead of a column name. Surrounding it in quotes just makes “from” populate the result set. Weird.
Can I do anything short of renaming the column? (Which isn’t too bad, since the table really has no real data right now).
Thanks!
What I have now:
SELECT from,id FROM permissions
Backticks should work in this situation.
e.g.
But ideally you’d rename it. Perhaps to make it more descriptive also, e.g. “rangeFrom” or “dateFrom”, etc.