gpt4 book ai didi

mysql - 尝试获取列名称为 'ssl' 的列的记录时,选择查询不起作用

转载 作者:可可西里 更新时间:2023-11-01 08:16:32 28 4
gpt4 key购买 nike

有人可以告诉我这个查询有什么问题吗?

mysql> select dom_id, ssl from hosting;

我遇到以下错误:

ERROR 1064 (42000): You have an error in your SQL syntax; check the
manual that corresponds to your MySQL server version for the right
syntax to use near 'ssl from hosting' at line 1

如果我删除 ssl,则查询会给出应有的结果。

注意:dom_id和ssl都是hosting表的两列。

最佳答案

试试这个

select `dom_id`, `ssl` from hosting;

ssl 是 mysql 的关键字。所以请用“`”这个标志

关于mysql - 尝试获取列名称为 'ssl' 的列的记录时,选择查询不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25458430/

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