首页 > 数据库技术 > 详细

oracle 多列=多列

时间:2020-08-27 22:27:59      阅读:84      评论:0      收藏:0      [点我收藏+]

oracle 多列=多列

https://www.cnblogs.com/hijushen/p/4273929.html
https://blog.csdn.net/hello__word__/article/details/88354694

多列更新

UPDATE WMS_CUSTOMER_CONFIG C
   SET (C.WORK_DESCRIPTION,
        C.S_IS_GROUP_OLD_ITEM,
        C.S_IS_GROUP_ITEM_CODE,
        C.S_IS_GROUP_LOT,
        C.S_IS_GROUP_ORDER_CODE,
        C.S_IS_GROUP_PD,
        C.S_IS_GROUP_LD) =
       (SELECT T.WORK_DESCRIPTION,
               T.S_IS_GROUP_OLD_ITEM,
               T.S_IS_GROUP_ITEM_CODE,
               T.S_IS_GROUP_LOT,
               T.S_IS_GROUP_ORDER_CODE,
               T.S_IS_GROUP_PD,
               T.S_IS_GROUP_LD
          FROM TEMP_CONFIG T
         WHERE T.ID = C.ID)
WHERE C.ID = (SELECT T.ID FROM TEMP_CONFIG T WHERE T.ID = C.ID);
WHERE EXISTS (SELECT T.ID FROM TEMP_CONFIG T WHERE T.ID = C.ID);
 
 
多列 in 条件
SELECT C.ID,
       C.S_IS_GROUP_OLD_ITEM,
       C.S_IS_GROUP_ITEM_CODE,
       C.S_IS_GROUP_LOT,
       C.S_IS_GROUP_ORDER_CODE,
       C.S_IS_GROUP_PD,
       C.S_IS_GROUP_LD
  FROM WMS_CUSTOMER_CONFIG C
WHERE (C.S_IS_GROUP_OLD_ITEM, C.S_IS_GROUP_ITEM_CODE, C.S_IS_GROUP_LOT,
        C.S_IS_GROUP_ORDER_CODE, C.S_IS_GROUP_PD, C.S_IS_GROUP_LD) IN
       (SELECT T.S_IS_GROUP_OLD_ITEM,
               T.S_IS_GROUP_ITEM_CODE,
               T.S_IS_GROUP_LOT,
               T.S_IS_GROUP_ORDER_CODE,
               T.S_IS_GROUP_PD,
               T.S_IS_GROUP_LD
          FROM TEMP_C T);

多列 = 条件 ,限制select返回仅1条记录
SELECT C.ID,
       C.S_IS_GROUP_OLD_ITEM,
       C.S_IS_GROUP_ITEM_CODE,
       C.S_IS_GROUP_LOT,
       C.S_IS_GROUP_ORDER_CODE,
       C.S_IS_GROUP_PD,
       C.S_IS_GROUP_LD
  FROM WMS_CUSTOMER_CONFIG C
WHERE (C.S_IS_GROUP_OLD_ITEM, C.S_IS_GROUP_ITEM_CODE, C.S_IS_GROUP_LOT,
        C.S_IS_GROUP_ORDER_CODE, C.S_IS_GROUP_PD, C.S_IS_GROUP_LD) =
       (SELECT T.S_IS_GROUP_OLD_ITEM,
               T.S_IS_GROUP_ITEM_CODE,
               T.S_IS_GROUP_LOT,
               T.S_IS_GROUP_ORDER_CODE,
               T.S_IS_GROUP_PD,
               T.S_IS_GROUP_LD
          FROM TEMP_C T WHERE ID=4041);

oracle 多列=多列

原文:https://www.cnblogs.com/Tty725/p/13574103.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!