Re: another complex SQL / extra() question

2007-09-06 Thread James Tauber
On Thu, 06 Sep 2007 11:59:35 -0500, "Tim Chase" <[EMAIL PROTECTED]> said: > It would help if you made a note of what "that doesn't work > either" means. Perhaps the actual error message or perhaps the > "wrong" resulting output along with the expected output. Well, it turned out the lack of resu

Re: another complex SQL / extra() question

2007-09-06 Thread Tim Chase
> SELECT t > FROM ( > SELECT thing.thing_id AS t, COUNT > (thing.thing_id) AS c > FROM ( > SELECT thing_id > FROM myapp_thing_sources > WHERE sour

Re: another complex SQL / extra() question

2007-09-06 Thread Nis Jørgensen
James Tauber skrev: > As before, I have a Thing model with a many-to-many relationship to > Source. > > For a given Source, I want to find those Things that come only from > that Source. > > This SQL works fine in dbshell (on sqlite): > > SELECT t > FROM ( >

another complex SQL / extra() question

2007-09-06 Thread James Tauber
As before, I have a Thing model with a many-to-many relationship to Source. For a given Source, I want to find those Things that come only from that Source. This SQL works fine in dbshell (on sqlite): SELECT t FROM ( SELECT thing.thing