Re: [sqlite] any keyword
On Wed, Nov 11, 2009 at 09:37:31AM +0100, Andrea Galeazzi wrote > 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; Maybe I'm mis-understanding your query. Can you use a subquery... SELECT G.id,name FROM Genre G WHERE G.id IN ( SELECT genre_id FROM Song ) ORDER BY name ASC; -- Walter Dnes ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] any keyword
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 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 >> sqlite-users@sqlite.org >> http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users >> >> > > > Artur Reilin > sqlite.yuedream.de > ___ > sqlite-users mailing list > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
Re: [sqlite] any keyword
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 > sqlite-users@sqlite.org > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > > Artur Reilin sqlite.yuedream.de ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[sqlite] any keyword
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 sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users