Hi, I was wondering if someone could lend some experience or
assistance to this problem.
I have a table.
t_stuff
--------
stuff_id int,
stuff_name varchar(10),
stuff_propname varchar(10),
stuff_propvalue varchar(10)
There could be multiple rows for any given "stuff_name" that
correspond to the number of name/value pairs inserted into the table.
I'd like to be able to "turn the row on its side", basically be able
to (through either a view or stored procedure, which ever would be
faster) create a report that would set all of the "stuff_propname"
fields as columns, with the "stuff_propalue"'s displayed in the
corresponding row for that column.
some sample data to make this more clear:
stuff_id stuff_name stuff_propname stuff_propvalue
-------- ---------- -------------- -----------------
1 apple color red
2 apple taste yummy
3 apple origin new york state
4 tomato color red
5 tomato taste hearty
6 tomato origin new jersey
7 tomato seeds true
report would look something like this
stuff_name color taste origin seeds
---------- ----- ----- ------ -----
apple red yummy new york state null
tomato red heary new jersey true
thanks for any and all help,
Ed