gpt4 book ai didi

mysql - 选择 where image_url=0 但返回所有行?

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

我正在尝试完成以下sql语句

预期结果只有 image_url 具有 0 值

SELECT product_id,image_url FROM tour_product where image_url = 0

但我得到的所有行都显示在下图中

enter image description here

谁能帮我解释为什么会这样。

最佳答案

您的 image_url 字段数据类型是字符串,因此它不接受数字,因此您使用单引号 ' '。

喜欢

SELECT product_id, image_url FROM tour_product WHERE image_url = '0'

关于mysql - 选择 where image_url=0 但返回所有行?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56061121/

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