为了避免全表扫描, 应该这样写,而不是实用count(*)函数, 对于海量数据全表扫描性能是极差的
- select fieldName1
- from tableName
- where fieldName2 = xxx
- and rownum < 2
- select fieldName1
- from tableName
- where fieldName2 = xxx
- and rownum <= 1
- select fieldName1
- from tableName
- where fieldName2 = xxx
- and rownum = 1