我在理解 SQL 中的 LIKE 和 NOT LIKE 运算符时遇到问题。这是我执行的查询:
select serial_number from UNIT U
group by serial_number
order by serial_number
产生2000个结果。
当我执行这个查询时,我得到 1950 个结果:
select serial_number from UNIT U
WHERE op_name LIKE 'Assembly'
group by serial_number
order by serial_number
所以当我执行这个查询时,我希望得到 50 个结果,但我得到了 2000 个:
select serial_number from UNIT U
WHERE op_name NOT LIKE 'Assembly'
group by serial_number
order by serial_number
有什么解释吗?谢谢一堆。