我想选择3列,并希望从MySQL表中检索数据。所有列都存在于称为orderTable
的单个表中。请检查我在做什么:
SELECT * FROM `orderTable` WHERE shipped = 0, reject_order = 0 AND customer_id = '26898'
请提出我的错。
答案 0 :(得分:2)
您使用的是逗号而不是AND或OR条件。查看正确的查询
SELECT * FROM `orderTable` WHERE shipped = 0 AND reject_order = 0 AND customer_id = '26898'
或
SELECT * FROM `orderTable` WHERE shipped = 0 OR reject_order = 0 AND customer_id = '26898'
您应根据自己的要求选择以上选项之一