此查询中的语法错误是什么?我无法解决。
SELECT
wsd.sid,
wsd.data as node_id
FROM
webform_submitted_data wsd
JOIN (
SELECT
wsd.sid,
wsd.data as md_email
FROM
webform_submitted_data wsd
WHERE
wsd.nid=48 AND wsd.cid=5
) tbl_md_email tmm ON tmm.sid = wsd.sid
WHERE
wsd.nid=48 AND wsd.cid=4
答案 0 :(得分:1)
可能错误是因为您在两个选择中使用相同的别名:“ webform_submitted_data wsd ”
尝试更改别名: “ webform_submitted_data wsd1 ”和 “ webform_submitted_data wsd2 ”(内部选择)
SP。
答案 1 :(得分:0)
试试这个:
SELECT
wsd.sid,
wsd.data AS node_id
FROM
webform_submitted_data AS wsd
JOIN
(
SELECT
sid,
data AS md_email
FROM
webform_submitted_data
WHERE
nid=48 AND cid=5
) AS tmm ON tmm.sid = wsd.sid
WHERE
wsd.nid=48 AND wsd.cid=4;