JohnDTampaBay
Programmer
I am working on metadata that uses two tables:
Properties table
MetaData table
The application (of which I have no control) allows the user to choose a property from a drop-down box (from Properties) or type one in manually. So the Metadata table contains values in PropertyName that aren't in the Properties table. The Properties table contains a list of some, but not all, properties.
I'd like to see the metadata including the default properties that have not been entered and manually entered properties.
Select output
Sounds like a job for a FULL OUTER JOIN, but every attempt I've made acts more like a LEFT or RIGHT OUTER JOIN, at best.
What I thought was a simple task has turned into a big hairy mess. I've twisted the code this way and that, but I am at a loss now. Can anyone lend me a hand? What am I missing? --Angel
-----------------------------------
SELECT * FROM users WHERE clue > 0
0 row(s) affected
Properties table
Code:
PropertyName IsDefault
------------------------------
Source Y
Description Y
MetaData table
Code:
ObjectName PropertyName PropertyValue
----------------------------------------------------------
Inventory Description What we have on hand
Inventory Keywords Goods Stuff Etc.
The application (of which I have no control) allows the user to choose a property from a drop-down box (from Properties) or type one in manually. So the Metadata table contains values in PropertyName that aren't in the Properties table. The Properties table contains a list of some, but not all, properties.
I'd like to see the metadata including the default properties that have not been entered and manually entered properties.
Select output
Code:
ObjectName PropertyName PropertyValue
----------------------------------------------------------
Inventory Description What we have on hand
Inventory Keywords Goods Stuff Etc.
Inventory Source NULL
Sounds like a job for a FULL OUTER JOIN, but every attempt I've made acts more like a LEFT or RIGHT OUTER JOIN, at best.
Code:
SELECT m.ObjectName,
IsNull(p.PropertyName, m.PropertyName) AS PropertyName,
m.PropertyValue
FROM Properties p
FULL OUTER JOIN Metadata m
ON p.PropertyName = m.PropertyName
What I thought was a simple task has turned into a big hairy mess. I've twisted the code this way and that, but I am at a loss now. Can anyone lend me a hand? What am I missing? --Angel
-----------------------------------
SELECT * FROM users WHERE clue > 0
0 row(s) affected