<legend id='f4r19'><style id='f4r19'><dir id='f4r19'><q id='f4r19'></q></dir></style></legend>
      <bdo id='f4r19'></bdo><ul id='f4r19'></ul>
    1. <tfoot id='f4r19'></tfoot>
      1. <small id='f4r19'></small><noframes id='f4r19'>

        <i id='f4r19'><tr id='f4r19'><dt id='f4r19'><q id='f4r19'><span id='f4r19'><b id='f4r19'><form id='f4r19'><ins id='f4r19'></ins><ul id='f4r19'></ul><sub id='f4r19'></sub></form><legend id='f4r19'></legend><bdo id='f4r19'><pre id='f4r19'><center id='f4r19'></center></pre></bdo></b><th id='f4r19'></th></span></q></dt></tr></i><div id='f4r19'><tfoot id='f4r19'></tfoot><dl id='f4r19'><fieldset id='f4r19'></fieldset></dl></div>

        是否有更好的 Oracle 运算符来进行空安全相等性检查?

        Is there better Oracle operator to do null-safe equality check?(是否有更好的 Oracle 运算符来进行空安全相等性检查?)
            <tbody id='lCXNk'></tbody>
        • <tfoot id='lCXNk'></tfoot>
          <legend id='lCXNk'><style id='lCXNk'><dir id='lCXNk'><q id='lCXNk'></q></dir></style></legend>
            <bdo id='lCXNk'></bdo><ul id='lCXNk'></ul>

            <i id='lCXNk'><tr id='lCXNk'><dt id='lCXNk'><q id='lCXNk'><span id='lCXNk'><b id='lCXNk'><form id='lCXNk'><ins id='lCXNk'></ins><ul id='lCXNk'></ul><sub id='lCXNk'></sub></form><legend id='lCXNk'></legend><bdo id='lCXNk'><pre id='lCXNk'><center id='lCXNk'></center></pre></bdo></b><th id='lCXNk'></th></span></q></dt></tr></i><div id='lCXNk'><tfoot id='lCXNk'></tfoot><dl id='lCXNk'><fieldset id='lCXNk'></fieldset></dl></div>

              <small id='lCXNk'></small><noframes id='lCXNk'>

                  本文介绍了是否有更好的 Oracle 运算符来进行空安全相等性检查?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  根据这个问题,执行的方式Oracle 中的相等检查,我希望将 null 视为相等的 null 类似于

                  According to this question, the way to perform an equality check in Oracle, and I want null to be considered equal null is something like

                  SELECT  COUNT(1)
                    FROM    TableA
                  WHERE 
                    wrap_up_cd = val
                    AND ((brn_brand_id = filter) OR (brn_brand_id IS NULL AND filter IS NULL))
                  

                  这确实会使我的代码变脏,尤其是当我有很多这样的 where 并且 where 应用于多个列时.有没有更好的替代方案?

                  This can really make my code dirty, especially if I have a lot of where like this and the where is applied to several column. Is there a better alternative for this?

                  推荐答案

                  好吧,我不确定这是否更好,但使用 LNNVL,一个函数(你只能在 WHERE 子句中使用),如果给定的表达式为 FALSE 或 UNKNOWN (NULL),则返回 TRUE.例如...

                  Well, I'm not sure if this is better, but it might be slightly more concise to use LNNVL, a function (that you can only use in a WHERE clause) which returns TRUE if a given expression is FALSE or UNKNOWN (NULL). For example...

                  WITH T AS
                  (
                      SELECT    1 AS X,    1 AS Y FROM DUAL UNION ALL
                      SELECT    1 AS X,    2 AS Y FROM DUAL UNION ALL
                      SELECT    1 AS X, NULL AS Y FROM DUAL UNION ALL
                      SELECT NULL AS X,    1 AS Y FROM DUAL
                  )
                  SELECT
                      *
                  FROM
                      T
                  WHERE
                      LNNVL(X <> Y);
                  

                  ...将返回除 X = 1 和 Y = 2 之外的所有行.

                  ...will return all but the row where X = 1 and Y = 2.

                  这篇关于是否有更好的 Oracle 运算符来进行空安全相等性检查?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  ibtmp1是非压缩的innodb临时表的独立表空间,通过innodb_temp_data_file_path参数指定文件的路径,文件名和大小,默认配置为ibtmp1:12M:autoextend,也就是说在文件系统磁盘足够的情况下,这个文件大小是可以无限增长的。 为了避免ibtmp1文件无止境的暴涨导致
                  SQL query to group by day(按天分组的 SQL 查询)
                  What does SQL clause quot;GROUP BY 1quot; mean?(SQL 子句“GROUP BY 1是什么意思?意思是?)
                  MySQL groupwise MAX() returns unexpected results(MySQL groupwise MAX() 返回意外结果)
                  MySQL SELECT most frequent by group(MySQL SELECT 按组最频繁)
                  Include missing months in Group By query(在 Group By 查询中包含缺失的月份)

                  <legend id='PkAi6'><style id='PkAi6'><dir id='PkAi6'><q id='PkAi6'></q></dir></style></legend>

                      <small id='PkAi6'></small><noframes id='PkAi6'>

                      <tfoot id='PkAi6'></tfoot>
                        <tbody id='PkAi6'></tbody>

                          <bdo id='PkAi6'></bdo><ul id='PkAi6'></ul>
                        • <i id='PkAi6'><tr id='PkAi6'><dt id='PkAi6'><q id='PkAi6'><span id='PkAi6'><b id='PkAi6'><form id='PkAi6'><ins id='PkAi6'></ins><ul id='PkAi6'></ul><sub id='PkAi6'></sub></form><legend id='PkAi6'></legend><bdo id='PkAi6'><pre id='PkAi6'><center id='PkAi6'></center></pre></bdo></b><th id='PkAi6'></th></span></q></dt></tr></i><div id='PkAi6'><tfoot id='PkAi6'></tfoot><dl id='PkAi6'><fieldset id='PkAi6'></fieldset></dl></div>