My db structure:
t_data_fields
id | field_name | field_value
t_data
id | fields_id | name |
Each of the rows in t_data have a number of rows associated with it in the t_data_fields table. Instead of joining data width data_fields and get multiple rows for each data entry, I was wondering if it's possible to append the extra field_name and field_value to the original t_data row.
So, instead of:
id fields_id name field_name field_value
2 1 row2 color black
2 1 row2 brand DG
2 1 row2 type shirt
I want the result like this:
id fields_id name field_name field_value field_name field_value field_name field_value
2 1 row2 color black brand DG type shirt
I could do the first version, I'm just curious to see if it is possible to get the result set like I would prefer