On Wed,  4 Aug 2004 08:48:01 +0200, <[EMAIL PROTECTED]> wrote:
> Any more ideas on how to get the result I want from SQLite?
> Or is this something that can't be done?

union the 2 sets of properties together.  if you need to add objects
with no properties, it would probably be easier to union them on the
end.

SELECT 
        object.object_id,
        p1.value_table,
        string_values.value as stringval,
        null as intval
>FROM object
JOIN properties p1 ON p1.object_id = object.object_id 
JOIN string_values ON string_values.property_id = p1.property_id
where p1.value_table = 1

UNION

SELECT 
        object.object_id,
        p1.value_table,
        null as stringval,
        int_values.value
>FROM object
JOIN properties p1 ON p1.object_id = object.object_id 
JOIN int_values ON int_values.property_id = p1.property_id
where p1.value_table = 2;

object.object_id  p1.value_table  stringval   int_values.value
----------------  --------------  ----------  ----------------
1                 2                           123
1                 1               Hallo

klint.

+---------------------------------------+-----------------+
: Klint Gore                            : "Non rhyming    :
: EMail   : [EMAIL PROTECTED]           :  slang - the    :
: Snail   : A.B.R.I.                    :  possibilities  :
: Mail      University of New England   :  are useless"   :
:           Armidale NSW 2351 Australia :     L.J.J.      :
: Fax     : +61 2 6772 5376             :                 :
+---------------------------------------+-----------------+

Reply via email to