MySQL Forums
Forum List  »  MySQL Query Browser

Query help from 2 tables
Posted by: Todd Toddski
Date: July 06, 2012 03:54PM

I have two tables, data and metadata. Metadata has these columns project_id(id of project, refrences Data's project_id), field_name(variable that that describes value, refrences Data's field_name) , element_label (label for field). Data has project_id (refrences metadata's project_id) , field_name (refrences metadata's field_name), value (the actual data value). I want it to output 3 things.

ex. project_id=1, field_name="Sex of person", element_label="SEX", value="MALE"
project_id=1, field_name="Age of person", element_label="AGE", value="20"

I want the element_label to be the "columns" in the finished query plus have a final column that shows the project_id (don't need field_name, but thought it might be used for refrencing tables). And under these element_label columns" to have the coressponding values. I am completley stuck how to do this, please help!


Options: ReplyQuote

Written By
Query help from 2 tables
July 06, 2012 03:54PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.