On 14 December 2017 at 01:19, Warren Young <war...@etr-usa.com> wrote:

> On Dec 12, 2017, at 10:24 AM, Simon Slavin <slav...@bigfraud.org> wrote:
> >
> >      Santa Clause: SELECT name,hobbies,address FROM people WHERE
> behaviour=‘nice’
>
> I think you mean
>
>     SELECT name,address
>     CASE behaviour
>       WHEN ‘nice' THEN
>         hobbies
>       ELSE
>         'coal'
>       END
>     FROM people
>

Surely "hobbies" should read something like:

    (SELECT gift FROM ideas WHERE ideas.hobby IN (SELECT value FROM
json_each(hobbies)) ORDER BY random() LIMIT 1)

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

Reply via email to