We should set up a wiki page on converting sql queries to empire-db code.

On Wed, Dec 9, 2009 at 10:15 AM, andrew cooke <[email protected]> wrote:
> Ah, sorry, this is the same as the prev Query here (use DBQuery).
> Please ignore,  Andrew.
>
>
> 2009/12/8 andrew cooke <[email protected]>:
>> Hi,
>>
>> I thought I had done this before, but now I can't work out what I did.
>>  I would like to construct this query, given that the appropriate
>> tables etc are defined:
>>
>> select ARTISTS.id, ARTISTS.value
>>  from ARTISTS
>>  left join (select ARTIST_CANONICAL.artist
>>               from ARTIST_CANONICAL
>>               join LFM_ARTIST_TAGS
>>                 on ARTIST_CANONICAL.canonical = LFM_ARTIST_TAGS.source) as X
>>    on ARTISTS.id = X.artist
>>  where X.artist is null;
>>
>> In case it helps, the logic is that I want the rows from ARTISTS that
>> do not have any link, via the association table ARTIST_CANONICAL, with
>> LFM_ARTIST_TAGS.
>>
>> It's all "trivial" except for "ARTISTS.id = X.artist" - I have a
>> DBCommand that represents X, but it has no attribute for the column.
>> Somehow I need to convert the command to something that is table-like
>> (I think).
>>
>> Thanks,
>> Andrew
>>
>



-- 
http://www.somatik.be
Microsoft gives you windows, Linux gives you the whole house.

Reply via email to