我需要将成员从 ExpressionEngine 移动到 WordPress。到目前为止,我在 Stackoverflow 上得到了以下查询的帮助,该查询效果很好并产生了 696 个结果(正确的成员数量)。但是,我还需要从另一个表中导出一些列,当我将它们添加到查询中时,我得到 484416 个结果(696 x 696)。
这是返回 696 个结果的原始查询:
SELECT username AS user_login,
username AS user_nicename,
email AS user_email,
url AS user_url,
screen_name AS display_name,
FROM_UNIXTIME(join_date) AS user_registered
FROM exp_members
这是我想做的,我尝试用Navicat的查询生成器来做。m_field_id_1
从表中获取调用的列exp_member_data
并将其返回为user_location
. 此查询产生 484416 个结果。
SELECT exp_members.username AS user_login,
exp_members.username AS user_nicename,
exp_members.email AS user_email,
exp_members.url AS user_url,
exp_members.screen_name AS display_name,
FROM_UNIXTIME(join_date) AS user_registered,
exp_member_data.m_field_id_1 AS user_location // here is the m_field_id_1
FROM exp_members, exp_member_data
如何正确组合这 2 个表,以便仍然只有 696 个返回结果但带有附加列?谢谢