gpt4 book ai didi

php - 为什么较高的 mysql 版本会出错

转载 作者:行者123 更新时间:2023-11-30 22:48:16 25 4
gpt4 key购买 nike

我有一个在本地主机上正常运行的 sql 查询,但是当我将它上传到安装了更高版本 MySQL 的真实服务器时,它给我错误:

" #1054 - Unknown column 'subject.customers_fullname' in 'field list' "

这里是查询...

SELECT nf.*,
actor.customers_fullname AS actor_name,
actor.customers_id AS actor_id,
subject.customers_fullname AS subject_name
FROM portal_notifications nf,
customers actor,
customers SUBJECT
WHERE subject_id = 1
AND nf.actor_id = actor.customers_id
AND nf.subject_id = SUBJECT.customers_id
AND status = 'unseen'
ORDER BY nf.id DESC LIMIT 0,10

最佳答案

尝试将此写在字段列表中,因为别名是 SUBJECT 并且您使用的是 subject,它在 UNIX 中区分大小写。

SUBJECT.customers_fullname AS subject_name

代替

subject.customers_fullname AS subject_name

By default, table aliases are case sensitive on Unix, but not so on Windows or Mac OSX.

别名在 UNIX 操作系统中区分大小写 Reference .

关于php - 为什么较高的 mysql 版本会出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28912396/

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