SQL> delete from test10 where id is null;
已删除 1 行。
SQL> commit;
提交完成。
SQL> select *
from (select /*+ index_desc(test10 test10_idx1) */
id
from test10
where rownum < 2) a1,
(select /*+ index_asc(test10 test10_idx1)*/
id
from test10
where rownum < 2) a2; 2 3 4 5 6 7 8 9
ID ID
---------- ----------
1 1
SQL> ALTER TABLE TEST10 MODIFY ID NOT NULL;
表已更改。
SQL> select *
from (select /*+ index_desc(test10 test10_idx1) */
id
from test10
where rownum < 2) a1,
(select /*+ index_asc(test10 test10_idx1)*/
id
from test10
where rownum < 2) a2; 2 3 4 5 6 7 8 9
ID ID
---------- ----------
100000 1
NULL值会影响SQL查询结果
最新推荐文章于 2022-10-10 01:29:11 发布
本文通过示例展示了NULL值如何影响SQL查询结果。在删除NULL行并修改表结构为NOT NULL后,查询结果发生变化,强调了NULL在数据库操作中的特殊性。
摘要由CSDN通过智能技术生成