Re: [sqlite] Using nested SELECT with json_each()

2016-10-11 Thread Jens Alfke
Thanks much! (I’d forgotten about EXPLAIN QUERY PLAN — I had tried regular EXPLAIN, but the long list of virtual-machine instructions was too much for my brain.) —Jens ___ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org

Re: [sqlite] Using nested SELECT with json_each()

2016-10-11 Thread Clemens Ladisch
Jens Alfke wrote: > SELECT DISTINCT user.name > FROM user, json_each(user.phone) > WHERE json_each.value LIKE '704-%'; 0|0|0|SCAN TABLE user 0|1|1|SCAN TABLE json_each VIRTUAL TABLE INDEX 1: 0|0|0|USE TEMP B-TREE FOR DISTINCT > For my purposes it seems cleaner to use a nested

[sqlite] Using nested SELECT with json_each()

2016-10-11 Thread Jens Alfke
I’m writing code to generate SQL queries that use json_each to test the contents of a JSON array. The docs give this as an example: SELECT DISTINCT user.name FROM user, json_each(user.phone) WHERE json_each.value LIKE '704-%'; I’m not happy with this, as it requires the