Snowflake - IS DISTINCT FROM - Stack Overflow

I'm comparing to tables with the following:WHERE tab1.id_1::date between 'YYYY-MM-DD' A

I'm comparing to tables with the following:

WHERE tab1.id_1::date between 'YYYY-MM-DD' AND 'YYYY-MM-DD'
AND ((tab1.id_2 IS DISTINCT FROM tab2.id_2)
OR (tab1.id_3 IS DISTINCT FROM tab2.id_3)
OR (tab1.id_4 IS DISTINCT FROM tab2.id_4)
... -- a lot more conditions
)

The query is currently returning a large number of rows, many of which appear identical upon closer inspection. To optimize the result set, I only need to retrieve rows where at least one column differs between the two tables. Additionally, if two columns both contain null values, they should be considered equal and not included in the result set.

Thoughts?

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742391107a4435033.html

相关推荐

  • Snowflake - IS DISTINCT FROM - Stack Overflow

    I'm comparing to tables with the following:WHERE tab1.id_1::date between 'YYYY-MM-DD' A

    1天前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信