Subject Re: [Firebird-general] Select master with multiple detail
Author Dimitry Sibiryakov
20.10.2010 8:27, Lester Caine wrote:
> I have extended a section so allow filtering of a list of records based on a
> number of 'tags' where these are stored as a set of detail records, but I'm
> struggling with getting a list of results which have a single entry per item.
>
> Detail record has alphanumeric key like '$00', $01', $02'... and I need to limit
> the master list to say 'where detail key in ('$00', '$02')'. This should be
> easy, but I'm having a bit of a block to the thought process at present :(

Put your detail keys into temporary table and you'll be able to choose between SELECT
DISTINCT ... JOIN and SELECT ... WHERE EXISTS ...

--
SY, SD.