我希望下面的代码向我显示表中交换列为null但结果集显示0行的所有记录。知道为什么吗?
SELECT * FROM pubco WHERE exchange IS NULL;
也许您将其解释''为NULL不相同,但请尝试此操作
''
NULL
SELECT * FROM pubco WHERE exchange IS NULL OR exchange = ''
但如果仍然无法获得价值,也许它上面有空格,那么您应该TRIM这样做,
TRIM
SELECT * FROM pubco WHERE exchange IS NULL OR TRIM(exchange) = ''