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;
  • 相关阅读:
    android view生命周期
    ViewPager 滑动页(四)
    android 中如何获取camera当前状态
    Android LayoutInflater原理分析,带你一步步深入了解View(一)
    仿Twitter登陆移动背景效果
    Android应用性能优化之使用SQLiteStatement优化SQLite操作
    GreenDao官方文档翻译(下)
    高级IO
    linux信号
    LINUX进程
  • 原文地址:https://www.cnblogs.com/007sx/p/11322265.html
Copyright © 2011-2022 走看看