I have a query with that joins two tables. One table contains a part and part_id, and another table contains property_name, property_value, and related part_id.
The problem that I'm having is that every part may not have every property. If I join the part_id field, and select property_value where property_name="Size", then all of the Part_ids where the property_name="Size" does not exist are ignored.
If I just do property_name="Size" or property_name<>"Size" then I get all the records for any property. I just want to determine if the size property exists for this field, and if it doesn't I want a 0 there instead, without adding a bunch of rows back to my table.
I want the Size column in my query to display the size when that property is present, but display 0 or some other value when that property is not present.
How do I deal with these orphaned/absent rows in my table?
The problem that I'm having is that every part may not have every property. If I join the part_id field, and select property_value where property_name="Size", then all of the Part_ids where the property_name="Size" does not exist are ignored.
If I just do property_name="Size" or property_name<>"Size" then I get all the records for any property. I just want to determine if the size property exists for this field, and if it doesn't I want a 0 there instead, without adding a bunch of rows back to my table.
I want the Size column in my query to display the size when that property is present, but display 0 or some other value when that property is not present.
How do I deal with these orphaned/absent rows in my table?