I have a table of name value pairs where I am storing tags:
TAGID | NAME | VALUE
I have a table of 'Things' this tags apply to
THINGID | TAGID
I need a query to generate a resultSet were the columns/fields are all possible TAG-NAMES (NAME field in the TAG table)for a given THINGID and the values are the correspondent tag values.
THINGID | TAGNAME1 | TAGNAME2 | ... |etc.
I can find examples with fixed columns but nothing like this.
Something similar with slightly different schema (thing_id, tag_name, tag_value) - without tags table:
I figured out that this works way too slow and stopped tuning it further, but it sort of works up to your requirement.