sql column names with single quotes I've a table the includes two columns ID and age. When view the table, the columns names are in single quotes. That's, 'ID', 'AGE'.
If I tried to do a simple select statement for ID:
SELECT ID FROM table1 

I'll be getting an error message of &quot;invalid identifier 'ID' &quot;
What's the solution here?
I hope this is not the case, or you're going to get tons of problems down the line.
It's a Bad Idea to have any kind of &quot;special&quot; character in column names and single quotes would be just mind-bendingly difficult to work with.
Try this:
select `'ID'` from table1 ; 

(That's Back-Tick, Single-Quote, capital-Eye, capital-Dee, Single-Quote, Back-Tick.)
If that does work (and I really, really hope it doesn't), then go find out who created this table and give them a damned good kicking!
If it doesn't work, then run this command and send us the output from it:
show create table table1 \g