>
>

Simon Charette, on Tuesday, October 8, 2019 08:00 PM, wrote...
>
> While trying to enable support for FILTER (WHERE) on SQLite 3.30 for
> the Django ORM we discovered a crash that can be reduced to the
> following
>
> sqlite> CREATE TABLE item (id int, price int);
> sqlite> INSERT INTO item (id, price) VALUES (1, 1);
> sqlite> SELECT COUNT(id) FILTER (WHERE double_price > 42) FROM (SELECT
> id, (price * 2) as double_price FROM item);
> Erreur de segmentation (core dumped)

I get this,

sqlite> CREATE TABLE item (id int, price int);
sqlite>  INSERT INTO item (id, price) VALUES (1, 1);
sqlite>  SELECT COUNT(id) FILTER (WHERE double_price > 42) FROM (SELECT
   ...> id, (price * 2) as double_price FROM item);
Error: near "FROM": syntax error

why don't you just do the simpler,

sqlite> select count(id) from item where price * 2 > 42;
0
sqlite> select count(id) from item where price * 2 > 1;
1

I know, because you are probably trying to use that FILTER thingy. :-)  Thanks.

josé
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to