Hi ka2,
The following statement created a table, but only the ‘id’ and ‘cpd_area’ columns show correct values; other columns show ‘NULL’ value.
CREATE TABLE wp_testing1
SELECT entry_id,
CASE
WHEN slug=’profession’ THEN value
ELSE NULL
END AS profession,
CASE
WHEN slug=’cpd_name’ THEN value
ELSE NULL
END AS cpd_name,
CASE
WHEN slug=’cpd_year’ THEN value
ELSE NULL
END AS cpd_year,
CASE
WHEN slug=’cpd_area’ THEN value
ELSE NULL
END AS cpd_area,
CASE
WHEN slug=’cpd_units’ THEN value
ELSE NULL
END AS cpd_units,
CASE
WHEN slug=’note’ THEN value
ELSE NULL
END AS note
FROM wp_cf_form_entry_values
GROUP BY entry_id;