Staffan Tylen wrote:
> On Tue, Sep 24, 2013 at 6:50 PM, Simon Slavin <[email protected]> wrote:
>
>> On 24 Sep 2013, at 5:35pm, Staffan Tylen <[email protected]> wrote:
>>
>>> sqlite> .tables
>>> City Country Languages
>>> Country Country Official Languages
>>> Country Capitals CountryLanguage
>> Either don't use spaces in your token names (table names, column names,
>> index names, etc.) or quote them when you use them. Something like
>>
>> select count(*) from "country official languages";
>>
>> or
>>
>> select count(*) from [country official languages];
>>
>> will probably work. I avoid all space in token names because they cause
>> problems with other versions of SQL too, and I don't want to get into
>> dangerous habits.
> Well, it's not my database I'm looking at. What puzzles me is that Country
> Languages works but Country Official Languages doesn't, so could there be a
> parsing problem?
No. `Languages` is interpreted as *alias* to table `Country`:
SELECT ... FROM Country Languages
is same as
SELECT ... FROM [Country] AS [Languages]
And
SELECT ... FROM Country Official
is same as
SELECT ... FROM [Country] AS [Official]
And that's why `SELECT ... FROM Country Languages` return exactly same result as
`SELECT FROM Country Official`; if you would've issued just `SELECT ... FROM
Country`, it would've returned same result as well.
> I agree, the names should be quoted ...
>
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users