需求:传入订单号返回不存在得订单号列表
思路:构建一个订单号得视图 在通过extis判断是否存在
重点:
select order_no from (select '传入值A' order_no union
select '传入值B' order_no union select '传入值A' order_no ......) a where
exits (Select 1 from order b where a.order_no=b.order_no)
这篇博客探讨了如何通过SQL查询来验证传入的一组订单号是否存在于订单数据库中。作者提出了一种方法,构建一个视图并使用EXISTS操作符来筛选不存在于数据库中的订单号。这种方法对于批量检查订单状态和数据同步操作具有实际应用价值。
需求:传入订单号返回不存在得订单号列表
思路:构建一个订单号得视图 在通过extis判断是否存在
重点:
select order_no from (select '传入值A' order_no union
select '传入值B' order_no union select '传入值A' order_no ......) a where
exits (Select 1 from order b where a.order_no=b.order_no)
1435

被折叠的 条评论
为什么被折叠?