- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
测试 #1:
我有一个用户定义的函数和一个 CONNECT BY LEVEL 查询:
with function custom_function(p_id in number) return number
is
begin
return p_id;
end;
select
custom_function(level)
from
dual
connect by level <= 1000
ID
--
1
2
3
4
5
6
7
8
9
10
...
10 rows of 1000
该非确定性函数按预期工作。它返回序列号,类似于未使用该函数。
测试 #2:
此测试与第一个相同,只是函数是确定性的:
with function custom_function(p_id in number) return number
deterministic is --this is what I changed
begin
return p_id;
end;
select
custom_function(level) id
from
dual
connect by level <= 1000
ID
--
1
1
1
1
1
1
1
1
1
1
...
10 rows of 1000
确定性函数没有按预期工作。与测试 #1 不同,它不返回序列号。如果我们查看完整的结果集,它会返回:
1
x 100101
x 100202
x 100303
x 100404
x 100505
x 100606
x 100707
x 100808
x 100909
x 100为什么 DETERMINISTIC 函数在 CONNECT BY LEVEL 查询中返回意外数字?
最佳答案
根据神谕 docs当数据库遇到确定性函数时,它会尽可能尝试使用先前计算的结果,而不是重新执行该函数。在您的情况下,没有使用先前计算结果的范围。
使属于这些类别的函数具有确定性是一种良好的编程习惯:
->WHERE、ORDER BY 或 GROUP BY 子句中使用的函数
->SQL 类型的 MAP 或 ORDER 方法的函数
->帮助确定行是否出现在结果集中或出现在结果集中的位置的函数
附带说明一下,这似乎是 18C 中的错误,因为相同的查询在 19c 和 21c 中运行良好,结果正确。
关于sql - 为什么确定性函数在 CONNECT BY LEVEL 查询中返回意外数字?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72871656/
我是业余时间的 Java 开发者,我只是想知道 level.tick() 和 Level.tick(level) ('Level' 是类的名称,'level' 是该类的对象) 我知道,由于 java
在 asp.net MVC 中的 Level Views Level 或 Model level 中验证更明智 以及有关 MVC 中验证的良好教程的链接? 最佳答案 验证应始终在可能的情况下在客户端和
当使用随机数生成器时,为了使新值具有更大的随机性,这是更好的使用方式: 有没有一种每次都实例化一个新的 RNG 实例然后返回一个值的方法? 在类级别有一个 RNG 实例,它在构造函数中实例化一次,并且
我在理解“单一责任原则”时遇到问题。应该在类级别或方法级别应用SRP。 可以说我有学生类,我需要创建学生,更新学生和删除学生。 如果我创建一个具有用于这三个操作的方法的服务类,则会违反SRP原则。 最
按照目前的情况,这个问题不适合我们的问答形式。我们希望答案得到事实、引用或专业知识的支持,但这个问题可能会引发辩论、争论、投票或扩展讨论。如果您觉得这个问题可以改进并可能重新打开,visit the
这个问题与语言无关。枚举级别之间有什么区别。在应用程序中,我看到许多 INFO 消息对我来说似乎是 DEBUG 信息,反之亦然。 最佳答案 对此有多种不同的解释。我个人的看法是: 信息 - 与申请状态
似乎最好只为顶级函数创建一次 FunPtr,而不是在需要时创建一个新的函数(同一函数)并处理其释放。 除了 foreign import ccall "wrapper" 之外,我是否忽略了获取 Fun
我正在经历以下 link了解在依赖倒置原则的背景下高级和低级模块的含义。 根据那里给出的解释,以下代码片段是一个好的/合适的示例吗? public class HighLevel { priv
我很好奇在 Java 应用程序中执行 URL 重写的最佳方法是什么。假设您有一个名为 test_app 的应用程序,我将其部署在 tomcat 上。 通过 URL 重写,我的意思是我不想通过 host
我试图找到最有效的方法来检查给定的字符串是否为回文。 首先,我尝试了蛮力,其运行时间为 O(N)。然后我通过只进行 n/2 次比较而不是 n 次来稍微优化代码。 代码如下: def palindrom
我有一个包含一些随机自然数的表格,例如: number ------- 2 3 1 我想从这个表中检索一个集合,其中每一行都将包含与值显示的次数一样多的次数,例如上面它将是: number -----
我一直在了解测试驱动开发的优势,并尝试使用 pytest 开发我的第一个 TDD 应用程序和 setuptools 开发 选项。到目前为止进展顺利。我有一个问题:我的 test_* 模块中应该将要测试
我想将特定记录器名称、特定级别或更高级别(比如 INFO 及以上)的消息记录到特定的日志处理程序,比如文件处理程序,同时仍然获取所有日志消息到控制台。 Python 是 2.7 版。 到目前为止我尝试
DOM Level 0 事件与 DOM Level 2 事件有什么区别?我问是因为有人告诉我 Firefox 和 IE 以不同的顺序调用它们,而我以前从未听过这些术语。 最佳答案 DOM Level
其实我对token不是很了解..当我阅读 googleresearch/bert model 时,我看到了这些词。 # In the demo, we are doing a simple class
假设我们在站点中有一个页面,它显示了数据库中的一些记录。 我们需要显示按某列排序的记录。 哪种方法可以提供更好的性能:检索从数据库中排序的数据或在网格上应用排序? 谢谢 最佳答案 这取决于您要显示的数
其实我对token不是很了解..当我阅读 googleresearch/bert model 时,我看到了这些词。 # In the demo, we are doing a simple class
我有以下 CSS 下拉菜单标记: FieldOne LevelOne FieldTwo LevelOne FieldThree LevelOne
这个问题已经有答案了: What is the difference between DOM Level 0 events vs DOM Level 2 events? (2 个回答) 已关闭 9 年
如何通过搜索数组(第 2 级)中的重复值来删除一行数组(第 1 级)? $array = array( 0 => array('name' => 'haha1', 'dateline' => '
我是一名优秀的程序员,十分优秀!