Double quotes can be used to specify that you mean a database object when
the name of the object might be confused with a keyword.  For example, my
company's database models a production system with various recipes.  We
call them "cycles".  But the word "cycle" appears to have some specific
meaning inside SQL (or at least, inside PostgreSQL).  So, although the
query
   SELECT * FROM cycle
works, we should probably use
    SELECT * FROM "cycle"
to avoid any possible ambiguity.

RobR

On Fri, Sep 14, 2018 at 2:12 PM Rob Richardson <cedriccic...@gmail.com>
wrote:

> The use of single quotes instead of double quotes in database queries is
> not limited to SQLite.  That's part of the SQL standard.
>
> RobR
>
> On Fri, Sep 14, 2018 at 2:05 PM David Raymond <david.raym...@tomtom.com>
> wrote:
>
>> Small typo:
>>
>> SELECT * FROM table2 JOIN table1
>>     ON table1.rowid = table2.rowid
>>     WHERE table1.name LIKE '%smth%'
>>
>>
>> -----Original Message-----
>> From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org]
>> On Behalf Of Simon Slavin
>> Sent: Friday, September 14, 2018 1:59 PM
>> To: SQLite mailing list
>> Subject: Re: [sqlite] [SQLITE]select from a table and use its data to
>> select from another one
>>
>> On 14 Sep 2018, at 6:50pm, Maziar Parsijani <maziar.parsij...@gmail.com>
>> wrote:
>>
>> > I have 2 tables with the same rowid now I want to :
>> > select rowid from table1 where table1 like "%smth%"
>> > select * from table2 where rowid =(selected rows before)
>> >
>> > I mean if I could do it in a same query.
>>
>> This is what JOIN is for.
>>
>>     SELECT * FROM table2
>>         JOIN table1.rowid = table2.rowid
>>         WHERE table1.name LIKE '%smth%'
>>
>> Note that SQLite uses single quotes ' for text strings, not double quotes
>> ".
>>
>> Simon.
>> _______________________________________________
>> sqlite-users mailing list
>> sqlite-users@mailinglists.sqlite.org
>> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>> _______________________________________________
>> sqlite-users mailing list
>> sqlite-users@mailinglists.sqlite.org
>> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>>
>
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to