qq_43294607
TTTTTHY
采纳率33.3%
2019-04-17 10:28

sql语句需要GROUP BY ,请问应该怎么样添加

需要修改一个sql,写在存储过程中,增加max(c.cust_uuid ) group by c.cust_uuid 的条件 ,不知应怎样修改,请教一下各位

 insert into CUST_CUST_OWNER (OW_UUID,SA_UUID,BR_UUID,OLD_SA_UUID,OLD_BR_UUID,
      REASON,OWNED_DATE,OWNED_TYPE,IS_ACTIVE,CREATED_DATE,UPDATED_DATE,CREATED_BY,UPDATED_BY,
      VERSION,CUST_UUID,OWNED_BY,CUST_NAME,CUST_PHONE,Changed_Type)
      select sys_guid(),C.Sa_Uuid,in$brUuid,d.owed_sa_uuid,d.owed_br_uuid,
      c.reason,sysdate(),'EXCEL','Y',sysdate(),sysdate(),c.created_by,c.updated_by,
      '0',c.cust_uuid,in$userId,c.cust_name,c.cust_phone,'EXCEL'
      from TEMP_CUST_CUST_OWNER c
      left join cust_cust_brsa_owner d on c.cust_uuid = c.cust_uuid and d.br_uuid = c.br_uuid
      where c.import_instance_uuid = in$instanceUuid and c.import_message is null AND C.Cust_Level = 'owner'; 
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

2条回答

  • ashuaige ashuaige 2年前

    增加max(c.cust_uuid ) group by c.cust_uuid 的条件要做什么?

    点赞 评论 复制链接分享
  • qq_36838959 qq_36838959 2年前

    是不是先吧代码做一个简单的整理,你才好添加进去,不然太乱了

    点赞 评论 复制链接分享

相关推荐