Don't you just want to use IN?

SELECT G.id,name FROM Genre G
WHERE G.id IN (SELECT S.genre_id FROM Song S)
ORDER BY name ASC;

/Jonas

On Wed, Nov 11, 2009 at 9:48 AM, Artur Reilin <[email protected]> wrote:
> Does it required the any key? Doesn't it work without it?
>
> greetings
>
> ------------------------
>
>> Probably sqlite doesn't support 'any' keyword as I write it in the
>> following query:
>> SELECT G.id,name FROM Genre G
>> WHERE G.id = ANY (SELECT S.genre_id FROM Song S)
>> ORDER BY name ASC;
>>
>> In this case I can write an equivalent query like:
>> select  G.id,name from Genre G
>> WHERE (SELECT COUNT(*) FROM Song S
>> WHERE G.id = S.genre_id) > 0
>> ORDER BY name;
>>
>> Anyway, could I avoid to use count which require a very long time? Does
>> the development
>> team have a plan including the 'any/all' keyword implementation? I think
>> it should be
>> useful for many users.
>> Regards
>> _______________________________________________
>> sqlite-users mailing list
>> [email protected]
>> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>>
>>
>
>
> Artur Reilin
> sqlite.yuedream.de
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to