Re: [sqlite] Single or double quotes when defining alias?

2019-10-28 Thread Thomas Kurz
Ok, thanks for everone's answer. - Original Message - From: James K. Lowden To: sqlite-users@mailinglists.sqlite.org Sent: Monday, October 28, 2019, 18:27:06 Subject: [sqlite] Single or double quotes when defining alias? On Fri, 25 Oct 2019 23:55:20 +0200 Thomas Kurz wrote: >

Re: [sqlite] Single or double quotes when defining alias?

2019-10-28 Thread James K. Lowden
On Fri, 25 Oct 2019 23:55:20 +0200 Thomas Kurz wrote: > SELECT column1 AS 'c' > --or-- > SELECT column2 AS "d" > > On the one hand, the name refers to a column or table identifier. The SQL-92 standard refers to that kind of name as a "correlation name", and its BNF grammar designates a

Re: [sqlite] Single or double quotes when defining alias?

2019-10-26 Thread Simon Slavin
On 26 Oct 2019, at 4:44am, Keith Medcalf wrote: > If the identifier is also a keyword and used in a location where it could be > that keyword Actually, any location. A SQL parser may pick out a SQL keyword even if it's in the wrong place in the wrong kind of SQL statement. And then issue a

Re: [sqlite] Single or double quotes when defining alias?

2019-10-25 Thread Keith Medcalf
On Friday, 25 October, 2019 20:45, Simon Slavin wrote: >On 25 Oct 2019, at 10:55pm, Thomas Kurz wrote: >> SELECT column2 AS "d" >If you want to do it, do it like that. Double quotes indicate an entity >name. Single quotes indicate a string of characters. >However, almost nobody quotes

Re: [sqlite] Single or double quotes when defining alias?

2019-10-25 Thread Simon Slavin
On 25 Oct 2019, at 10:55pm, Thomas Kurz wrote: > SELECT column2 AS "d" If you want to do it, do it like that. Double quotes indicate an entity name. Single quotes indicate a string of characters. However, almost nobody quotes entity names these days. The language is written so that you

Re: [sqlite] Single or double quotes when defining alias?

2019-10-25 Thread František Kučera
Dne 25. 10. 19 v 23:55 Thomas Kurz napsal(a) > this might be a stupid question, but do I have to use single or double quotes > when defining an alias? > > SELECT column1 AS 'c' > --or-- > SELECT column2 AS "d" > > On the one hand, the name refers to a column or table identifier. On the > other