gpt4 book ai didi

mysql左连接列重组

转载 作者:太空宇宙 更新时间:2023-11-03 12:32:20 24 4
gpt4 key购买 nike

我有一个名为 application_user 的表,其中有一个名为 id 的字段。另一个名为 voucher_info 的表有一个名为 maker_id 的字段。现在我想使用 maker_idid LEFT JOIN application_user 表和 voucher_info 表> ?但是显示此错误:

Error Code: 1054
Unknown column 'application_user.id' in 'on clause'

有人可以帮我解决这个问题吗?下面是我的代码:

LEFT JOIN application_user AS maker
ON(voucher_info.maker_id = application_user.id)

最佳答案

改成

ON (voucher_info.maker_id = maker.id)

一旦你给一个表起了别名,你就只能通过别名来引用它。

关于mysql左连接列重组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14825941/

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