I have an abstract relational database underneath some business objects... For instance, say I have two tables...
TABLE 1: A simple list of people...
ID USER
---------
1 Mike
2 John
TABLE 2: Name/Value pairs of attributes linked to table 1 by ID...
ID NAME VALUE
-------------------
1 Hair Brown
1 Eyes Blue
2 Weight 200
So you can see from this that Mike has brown hair and blue eyes, and that John weighs 200 lbs.
I want a query that selects a person and all their attributes (whatever they may be), and returns the results on one row like this (when run with a WHERE clause that selects user Mike).
USER HAIR EYES
-------------------
Mike Brown Blue
And returns this when run with a WHERE clause that selects user John...
USER WEIGHT
---------------
John 200
Any ideas? Thanks in advance!