Which quotes should I use in SQLite for column names?
Posted: Wed Jan 05, 2011 5:03 am
1. Double quotes (") are for identifiers, oddly, when used in ON ... clause, text inside double quotes is considered as literal value.
2. Single quotes (') are for literals, in some cases text inside single quotes can be considered as identifier.
3. Grave accents (`) and Brackets ([]) are for identifiers, but this is not standard SQL and included in SQLite for for compatibility.
I used no quotes, then I decided to use single quotes. I read on SQLite website, that single quotes are meant for literal values, so I changed to double quotes. But today I found that double quotes in JOIN ... ON ... clause case text inside them considered as literal.
What quotes should I use?
P.S. Shame there is no strict rules.
2. Single quotes (') are for literals, in some cases text inside single quotes can be considered as identifier.
3. Grave accents (`) and Brackets ([]) are for identifiers, but this is not standard SQL and included in SQLite for for compatibility.
I used no quotes, then I decided to use single quotes. I read on SQLite website, that single quotes are meant for literal values, so I changed to double quotes. But today I found that double quotes in JOIN ... ON ... clause case text inside them considered as literal.
What quotes should I use?
P.S. Shame there is no strict rules.