我需要显示两个表的内容;我的查询是这样的:
SELECT ID,
post_author,
post_content,
post_title,
post_name,
guid,
post_type,
meta_id,
post_id,
meta_key,
meta_value
FROM wp_posts,
wp_postmeta
WHERE wp_posts.ID = wp_postmeta.post_id
AND post_author IN (2);
meta_key 列存储我需要的内容类型,例如网站、纬度、经度、电话、电子邮件。有没有办法让这个列爆炸到另一个列?例如:
ID,
post_author,
...,
meta_id,
post_id,
meta_key,
meta_value,
website(its a meta_key result),
latitude(another meta_key result),
longitude(anoter meta_key result)...