• 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;
  • 相关阅读:
    Win32 键盘事件
    好用的Markdown 编辑器及工具
    如何激发您孩子的学习动力和兴趣
    横扫芯片后,紫光欲进军公有云 数百亿资金已到位(大事表)
    C#更改控制台文本颜色
    I/O多路复用
    Python 安装 httpie
    Elasticsearch 5.0
    认证架构
    注册微信小程序
  • 原文地址:https://www.cnblogs.com/007sx/p/11322265.html
Copyright © 2020-2023  润新知