为了避免全表扫描, 应该这样写:
Sql代码 
- select spu_id
- from tbcat2.spu
- where category_id = #value#
- and (status = 0 or status is null)
- and rownum < 2
select spu_id from tbcat2.spu where category_id = #value# and (status = 0 or status is null) and rownum < 2
而不是实用count(*)函数, 对于海量数据全表扫描性能是极差的
相关文章:
-
2022-12-23
-
2021-12-21
-
2021-12-09
-
2021-09-17
-
2021-10-20
-
2021-12-31
-
2022-02-02
-
2021-12-27
猜你喜欢
-
2021-12-09
-
2022-12-23
-
2022-12-23
-
2022-12-23
-
2021-09-26
-
2022-03-09
-
2022-12-23
相关资源
-
下载
2022-12-30
-
下载
2023-02-08
-
下载
2022-12-29