SELECT
A.company_name,
max( A.contacts ) AS contact,
max( A.email ) AS email
FROM
(
SELECT
company_name,
CASE
WHEN items = "contacts" THEN
item_values ELSE ""
END AS contacts,
CASE
WHEN items = "email" THEN
item_values ELSE ""
END AS email
FROM
shunqi_result
) as A
GROUP BY
company_name;
mysql 行转列
最新推荐文章于 2024-11-10 22:27:03 发布