zoukankan      html  css  js  c++  java
  • rds

    rds 不支持账户A 给账户B 创建授权存储过程,只能是当前登录账户给自己创建,要登陆对应账户删除原有存储过程重新创建即为修改。

     

    例子如下:

    先登陆新账号然后执行如下sql语句即可:

    DROP PROCEDURE IF EXISTS `sp_channel_report`;
    CREATE DEFINER = CURRENT_USER PROCEDURE `sp_channel_report`()
    BEGIN
        
        set @largeLoan = 10007;
        set @today = curdate();
        
        select concat('[',group_concat(concat('{"name":"',a.name,
            '","largeLoanAccessTotal":',(select count(type) from access_url_log where type=0 and dc_id=a.id and upi_id=@largeLoan),
            ',"largeLoanClickTotal":',(select count(type) from access_url_log where type=1 and dc_id=a.id and upi_id=@largeLoan),
            ',"loanEntranceClickTotal":',(select count(type) from access_url_log where type=1 and dc_id=a.id and upi_id>@largeLoan and to_days(create_time)=to_days(now())),
            ',"loanEntranceAccessTotal":',(select count(id) from (select id,dc_id from access_url_log where type=0 and upi_id>@largeLoan group by dc_id,ip_addr) t where dc_id=a.id),
            ',"todayUserAccessTotal":', (select count(dc_id) from (select dc_id,ip_addr from access_url_log where create_time>=@today and upi_id>@largeLoan group by dc_id,ip_addr) t where dc_id=a.id),
            '}')), ']') as str
        from download_channel a;
        
    END;
  • 相关阅读:
    Django~1
    Codeforces Round#201(div1) D. Lucky Common Subsequence
    ACdream原创群赛(18)のAK's dream题解
    区间dp
    部署AlwaysOn第三步:集群资源组的健康检测和故障转移
    Join 和 App
    SSRS配置1:凭证和邮件
    巧用Alt 键
    把Excel的数据导入到数据库
    jvm系列:Java GC 分析
  • 原文地址:https://www.cnblogs.com/007sx/p/11322265.html
Copyright © 2011-2022 走看看