【发布时间】:2014-06-17 12:18:54
【问题描述】:
当我输入时:
select * from 'saleslog' where 'Status' = 'Pending';
或
select * from 'saleslog' where 'Status' = "Pending";
或
select * from saleslog where Status = 'Pending';
尽管在“状态”列中有数百行具有“待定”值,但我只显示了 3 条记录。当我寻找“待定”以外的值时,也会发生同样的情况。
但是,如果我输入:
select * from saleslog where status like "%Pending%";
然后显示大部分(如果不是全部)记录。 Pending 值前后绝对不能有空格或任何其他字符。
我想知道是否需要修复表“saleslog”,如果需要,如何修复?我对 SQL 有点陌生。
【问题讨论】:
标签: mysql sql select command where