I have a table that looks like this:
ID | FIELD_NAME | VALUE
23 | sign_up | yes
23 | first_name | Fred
23 | street | Barber Lane
24 | sign
Am not sure there is a Pivot/Unpivot feature in MySQL. Try this:
SELECT a.ID,
c.FIELD_NAME AS SIGN_UP,
a.FIELD_NAME AS FIRST_NAME,
b.FIELD_NAME AS STREET
FROM a LEFT JOIN b
ON a.ID = b.ID
AND a.FIELD_NAME = 'first_name'
AND b.FIELD_NAME = 'street' LEFT JOIN c
ON c.ID = a.ID
AND c.FIELD_NAME = 'sign_up'