• I learnt about INTERSECT when I had a query which I couldn't write any other way.

    http://sci.esa.int/science-e/www/object/index.cfm?fobjectid=30910

    you see there are missions and topics, and an option of Match Any (or) of those selected and Match All (and).

    Unfortunately Missions and Topics all come from the same attribute id column, so I needed to compare missions and topics seperately, before 'AND'ing them together :).

    A logical nightmare.... and I was considering looping queries until .. INTERSECT

    the code...

    INTERSECT

    (SELECT objectid FROM OC4_OBJECTATTRIBUTEMAP where attributeid = #i#)

    INTERSECT (SELECT objectid FROM OC4_OBJECTATTRIBUTEMAP where attributeid IN (#m#))

    INTERSECT

    (SELECT objectid FROM OC4_OBJECTATTRIBUTEMAP where attributeid = #i#)

    INTERSECT (SELECT objectid FROM OC4_OBJECTATTRIBUTEMAP where attributeid IN (#t#))

    code is a bit broken, but you get the idea!