gpt4 book ai didi

mysql - mysql 检查主表中的值的子查询给出了 undefined variable 的错误

转载 作者:行者123 更新时间:2023-11-29 15:26:24 25 4
gpt4 key购买 nike

我的查询如下

SELECT
*
FROM`punit_master` `a`

LEFT JOIN
(
SELECT *
FROM
(
SELECT *
FROM _map_contacts as t
LEFT JOIN contact_master as c on c.contact_id = t.contact_id
where t.punit_id =a.punit_id
limit 1

) tm LEFT JOIN contactdetail_master cd ON cd.contactdetail_id = tm.contactdetail_id
) b ON b.agreement_id = a.curr_tenant_agreement_id

它给了我 a.punit_id is undefine 的错误

如何在子查询内的左连接中使用邮件表值

最佳答案

    SELECT
*
FROM `punit_master` `a`
LEFT JOIN
(
SELECT *
FROM
(
SELECT *
FROM _map_contacts as t
LEFT JOIN contact_master as c
ON c.contact_id = t.contact_id
) tm
LEFT JOIN contactdetail_master cd
ON cd.contactdetail_id = tm.contactdetail_id
) b
ON b.agreement_id = a.curr_tenant_agreement_id and a.punit_id = b.punit_id

试试这个! :)

关于mysql - mysql 检查主表中的值的子查询给出了 undefined variable 的错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59051099/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com