zoukankan      html  css  js  c++  java
  • Mysql存储

    BEGIN
    # 统计视频使用的模板数
    UPDATE VideoTemplate vt
    INNER JOIN (
    SELECT
    TemplateId,
    COUNT(TemplateId) AS TotalCount
    FROM
    VideoWorks
    WHERE
    Type = 1
    GROUP BY
    TemplateId
    ) work_total_count
    ON vt.Id = work_total_count.TemplateId
    SET vt.RenderTotalCount = work_total_count.TotalCount;
    END

    -----------------------------------------------------------------------------------------------------------

    BEGIN
    # 统计合成使用的背景音,主播,文本范例的数量
    UPDATE VideoBgm vb
    INNER JOIN (
    SELECT
    BgmId,
    COUNT(BgmId) AS TotalCount
    FROM
    VideoWorks
    WHERE
    Type = 1
    GROUP BY
    BgmId
    ) work_total_count
    ON vb.Id = work_total_count.BgmId
    SET vb.UseCount = work_total_count.TotalCount;

    UPDATE VideoTextExample vte
    INNER JOIN (
    SELECT
    TextExampleId,
    COUNT(TextExampleId) AS TotalCount
    FROM
    VideoWorks
    WHERE
    Type = 1
    GROUP BY
    TextExampleId
    ) work_total_count
    ON vte.Id = work_total_count.TextExampleId
    SET vte.UseCount = work_total_count.TotalCount;

    UPDATE ChannelAndSpeaker s
    INNER JOIN (
    SELECT
    SpeakerId,
    COUNT(SpeakerId) AS TotalCount
    FROM
    VideoWorks
    WHERE
    Type = 1
    GROUP BY
    SpeakerId
    ) work_total_count
    ON s.No = work_total_count.SpeakerId
    SET s.UseCount = work_total_count.TotalCount;
    END

  • 相关阅读:
    说说 Java 线程间通信
    Java 内存模型与内存结构
    Spring Boot 整合 Shiro
    HashMap 实现原理
    Spring Boot 自动配置原理
    Spring Cloud 全链路追踪实现
    JVM 类加载机制
    volatile 关键字的作用
    Spring Boot 整合 Redis
    Docker命令
  • 原文地址:https://www.cnblogs.com/qpf20190212/p/10402244.html
Copyright © 2011-2022 走看看