Marco Bambini | 9 Feb 23:17
Favicon
Gravatar

Explanation

sqlite 3.7.8 on MacOS X

This query works fine:
SELECT rowid, * FROM 'customer' WHERE rowid < 100;

While this query does not return anything:
SELECT rowid, * FROM 'customer' WHERE 'rowid' < 100;

Do you have an explanation?
--
Marco Bambini
http://www.sqlabs.com
http://twitter.com/sqlabs
Puneet Kishor | 9 Feb 23:19
Picon

Re: Explanation


On Feb 9, 2012, at 4:17 PM, Marco Bambini wrote:

> sqlite 3.7.8 on MacOS X
> 
> This query works fine:
> SELECT rowid, * FROM 'customer' WHERE rowid < 100;
> 
> While this query does not return anything:
> SELECT rowid, * FROM 'customer' WHERE 'rowid' < 100;
> 
> Do you have an explanation?

perhaps because in the second query 'rowid' is being treated as a string and not a column. You might want to
try "rowid" instead (double quotes).

--
Puneet Kishor

Gmane