MySQL计算环比、同比(年、月、季度)

本文涉及的产品
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
RDS MySQL Serverless 高可用系列,价值2615元额度,1个月
简介: MySQL计算环比、同比(年、月、季度)

MySQL计算环比、同比(年、月、季度)

环比

所谓“环比”即连续2个单位周期(比如连续两月)内的量的变化比。如今年8月比今年7月。 当然这里的单位不一定是月,可以是任何时间单位。


环比增长率=(本期数-上期数)/上期数×100%。

反映本期比上期增长了多少;环比发展速度,一般是指报告期水平与前一时期水平之比,表明现象逐期的发展速度。

同比

所谓“同比”即同期比较,可以是本年度与上年度,也可以是上年同一个月份或季度与本年同期。

同比增长率=(本期数-同期数)/|同期数|×100%。

案例

年月统计不同年份的销售总值,并计算环比(销售总额同比上期)、同比(销售总额同比去年同期)

20200401134307494.png

查询订单销售表结构

CREATE TABLE `food_orders_info` (
  `id` varchar(36) NOT NULL COMMENT '主键id',
  `pid` varchar(36) NOT NULL COMMENT '主订单id',
  `order_no` varchar(30) NOT NULL COMMENT '订单号生成规则 3大写英文-时间戳-3随机码(ZXC-201906241558-SX2)',
  `merchant_id` varchar(36) NOT NULL COMMENT '订单归属的经销商id',
  `buyer_id` varchar(36) NOT NULL COMMENT '买家id',
  `buyer_name` varchar(100) NOT NULL COMMENT '买家名称',
  `order_money` decimal(10,2) NOT NULL COMMENT '订单金额',
  `out_stock_money` decimal(10,2) DEFAULT NULL COMMENT '出库金额',
  `freight_money` decimal(10,2) NOT NULL COMMENT '运费',
  `driver_id` varchar(36) DEFAULT NULL COMMENT '司机id',
  `driver_name` varchar(36) DEFAULT NULL COMMENT '司机名称',
  `payment_state` bit(1) NOT NULL DEFAULT b'0' COMMENT '支付状态(0=未支付,1=已支付)',
  `payment_type` varchar(20) DEFAULT NULL COMMENT '支付方式(支付宝,微信,xx银行),预留字段暂不填写',
  `order_state` varchar(10) NOT NULL COMMENT '订单状态(00=预约单,10=待分拣,20=分拣中,30=待配送,40=配送中,50=待确认,60=已完成)',
  `abnormal_state` bit(1) NOT NULL DEFAULT b'1' COMMENT '异常状态,0=异常,1=正常',
  `order_resource` varchar(20) NOT NULL COMMENT '订单来源,暂时只有微信公众号',
  `receive_address` varchar(128) NOT NULL COMMENT '收货地址',
  `receive_man` varchar(100) NOT NULL COMMENT '收货人名称',
  `receive_tel` varchar(20) NOT NULL COMMENT '收货人联系电话',
  `address_longitude` varchar(36) DEFAULT NULL COMMENT '地址经度',
  `address_latitude` varchar(36) DEFAULT NULL,
  `delivery_date_start` timestamp NULL DEFAULT NULL COMMENT '配送开始时间',
  `delivery_date_end` timestamp NULL DEFAULT NULL COMMENT '配送时间结束时间',
  `receive_date_start` timestamp NULL DEFAULT NULL COMMENT '收货时间-开始时间',
  `receive_date_end` timestamp NULL DEFAULT NULL COMMENT '收货时间-截止时间',
  `receive_date_sure` timestamp NULL DEFAULT NULL COMMENT '确认收货时间',
  `if_end` bit(1) NOT NULL COMMENT '订单是否结束(0=未结束,1=结束)',
  `remark` varchar(512) DEFAULT NULL COMMENT '订单备注',
  `bill_id` varchar(36) DEFAULT NULL COMMENT '票据id,为空时表示该订单不开票',
  `sort` tinyint(4) NOT NULL DEFAULT '1' COMMENT '排序码',
  `state` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态(0=删除,1=正常)',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间(下单时间)',
  `create_user` varchar(36) NOT NULL COMMENT '创建人',
  `create_user_name` varchar(128) DEFAULT NULL,
  `last_modify_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '最后修改时间',
  `last_modify_user` varchar(36) NOT NULL COMMENT '最后修改人',
  `last_modify_user_name` varchar(128) DEFAULT NULL,
  `order_time_type` varchar(1) NOT NULL DEFAULT '1' COMMENT '订单类型,0预约单/1正常单/2加急单',
  `reduction_money` decimal(10,2) DEFAULT '0.00' COMMENT '满减金额',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='订单表';

备注:需要统计的是每个月的销售金额,而销售金额=出库金额-运费,即

sale_money= out_stock_money-freight_money;

create_time字段为下单时间,这里可以理解为销售时间


计算环比

思路:表a统计出每个年月份的销售总额,表b统计出上一个月的销售总额(在表a的基础上加上一个月,可得到上个月的销售量,这里可能有点绕),然后再将两个表进行左联接(通过now_time进行关联)。

20200401134307494.png

#当前月份的销售额

select 
date_format(a.create_time,'%Y-%m') as now_time,
sum( a.out_stock_money) AS  a_out_money,
sum( a.freight_money) AS a_fre_money,
CONVERT (sum( a.out_stock_money)-sum( a.freight_money),DECIMAL ( 10,2 )) as a_sale_money
from food_orders_info a
where a.state=1
and a.order_state=60
GROUP BY date_format(a.create_time,'%Y-%m')

#上个月的销售额

select 
date_format(DATE_ADD(b.create_time,INTERVAL 1 MONTH ), '%Y-%m')   as now_time,
sum( b.out_stock_money) AS bout_money,
sum( b.freight_money) AS bfe_money,
CONVERT (sum(b.out_stock_money)-sum( b.freight_money),DECIMAL ( 10,2 )) as bsale_money
from food_orders_info b
where b.state=1
and b.order_state=60
GROUP BY date_format(DATE_ADD(b.create_time,INTERVAL 1 MONTH ), '%Y-%m')

备注:

DATE_ADD(b.create_time,INTERVAL 1 MONTH )  #表示加一个月

#当前月和上月销售额进行关联

SELECT
  now_sale.now_time,
  now_sale.now_year,
CASE
    WHEN a_sale_money IS NULL 
    OR a_sale_money = 0 THEN
      0 ELSE a_sale_money 
    END this_sale_money,
CASE
    WHEN b_sale_money IS NULL 
    OR b_sale_money = 0 THEN
      0 ELSE b_sale_money 
    END last_month_money,
CASE
    WHEN b_sale_money IS NULL 
    OR b_sale_money = 0 THEN
      0 ELSE ( CONVERT ( ( ( a_sale_money - b_sale_money ) / b_sale_money ) * 100, DECIMAL ( 10, 2 ) ) ) 
    END month_ratio
FROM
  (
  SELECT
    date_format( a.create_time, '%Y-%m' ) AS now_time,
    date_format( a.create_time, '%Y' ) AS now_year,
    sum( a.out_stock_money ) AS a_out_money,
    sum( a.freight_money ) AS a_fre_money,
    CONVERT ( sum( a.out_stock_money ) - sum( a.freight_money ), DECIMAL ( 10, 2 ) ) AS a_sale_money 
  FROM
    food_orders_info a 
  WHERE
    a.state = 1 
    AND a.order_state = 60 
  GROUP BY
    date_format( a.create_time, '%Y-%m' ),
    date_format( a.create_time, '%Y' ) 
  ORDER BY
    date_format( a.create_time, '%Y-%m' ) ASC 
  ) now_sale
  LEFT JOIN (
  SELECT
    date_format( DATE_ADD( b.create_time, INTERVAL 1 MONTH ), '%Y-%m' ) AS now_time,
    sum( b.out_stock_money ) AS bout_money,
    sum( b.freight_money ) AS bfe_money,
    CONVERT ( sum( b.out_stock_money ) - sum( b.freight_money ), DECIMAL ( 10, 2 ) ) AS b_sale_money 
  FROM
    food_orders_info b 
  WHERE
    b.state = 1 
    AND b.order_state = 60 
  GROUP BY
    date_format( DATE_ADD( b.create_time, INTERVAL 1 MONTH ), '%Y-%m' ) 
  ORDER BY
    date_format( DATE_ADD( b.create_time, INTERVAL 1 MONTH ), '%Y-%m' ) ASC 
  ) old_sale ON now_sale.now_time = old_sale.now_time
ORDER BY
  now_sale.now_year DESC,
  now_sale.now_time ASC

得到的关联表

20200401134307494.png

由于数据库销售金额有为空的情况,所以的加上判断条件,让为空或被除数为空的值,返回0。

再查询去年同期的销售金额

SELECT
    date_format( DATE_ADD( c.create_time, INTERVAL 1 YEAR ), '%Y-%m' ) AS last_year_time,
    sum( c.out_stock_money ) AS bout_money,
    sum( c.freight_money ) AS bfe_money,
    CONVERT ( sum( c.out_stock_money ) - sum( c.freight_money ), DECIMAL ( 10, 2 ) ) AS last_year_money 
  FROM
    food_orders_info c 
  WHERE
    c.state = 1 
    AND c.order_state = 60 
  GROUP BY
  date_format( DATE_ADD( c.create_time, INTERVAL 1 YEAR ), '%Y-%m' ) 

DATE_ADD( c.create_time, INTERVAL 1 YEAR ) 表示加一年。

得到的表如下:

20200401134307494.png

最后,整合当前年月销售、上个月销售、去年同期销售。

SELECT
  now_sale.now_time,
  now_sale.now_year,
CASE
    WHEN a_sale_money IS NULL 
    OR a_sale_money = 0 THEN
      0 ELSE a_sale_money 
    END this_sale_money,
CASE
    WHEN b_sale_money IS NULL 
    OR b_sale_money = 0 THEN
      0 ELSE b_sale_money 
    END last_month_money,
CASE
    WHEN last_year_money IS NULL 
    OR last_year_money = 0 THEN
      0 ELSE last_year_money 
    END last_year_money,
CASE
    WHEN b_sale_money IS NULL 
    OR b_sale_money = 0 THEN
      0 ELSE ( CONVERT ( ( ( a_sale_money - b_sale_money ) / b_sale_money ) * 100, DECIMAL ( 10, 2 ) ) ) 
    END month_ratio,
CASE
    WHEN last_year_money IS NULL 
    OR last_year_money = 0 THEN
      0 ELSE ( CONVERT ( ( ( a_sale_money - last_year_money ) / last_year_money ) * 100, DECIMAL ( 10, 2 ) ) ) 
    END year_ratio 
FROM
  (
  SELECT
    date_format( a.create_time, '%Y-%m' ) AS now_time,
    date_format( a.create_time, '%Y' ) AS now_year,
    sum( a.out_stock_money ) AS a_out_money,
    sum( a.freight_money ) AS a_fre_money,
    CONVERT ( sum( a.out_stock_money ) - sum( a.freight_money ), DECIMAL ( 10, 2 ) ) AS a_sale_money 
  FROM
    food_orders_info a 
  WHERE
    a.state = 1 
    AND a.order_state = 60 
  GROUP BY
    date_format( a.create_time, '%Y-%m' ),
    date_format( a.create_time, '%Y' ) 
  ORDER BY
    date_format( a.create_time, '%Y-%m' ) ASC 
  ) now_sale
  LEFT JOIN (
  SELECT
    date_format( DATE_ADD( b.create_time, INTERVAL 1 MONTH ), '%Y-%m' ) AS now_time,
    sum( b.out_stock_money ) AS bout_money,
    sum( b.freight_money ) AS bfe_money,
    CONVERT ( sum( b.out_stock_money ) - sum( b.freight_money ), DECIMAL ( 10, 2 ) ) AS b_sale_money 
  FROM
    food_orders_info b 
  WHERE
    b.state = 1 
    AND b.order_state = 60 
  GROUP BY
    date_format( DATE_ADD( b.create_time, INTERVAL 1 MONTH ), '%Y-%m' ) 
  ORDER BY
    date_format( DATE_ADD( b.create_time, INTERVAL 1 MONTH ), '%Y-%m' ) ASC 
  ) old_sale ON now_sale.now_time = old_sale.now_time
  LEFT JOIN (
  SELECT
    date_format( DATE_ADD( c.create_time, INTERVAL 1 YEAR ), '%Y-%m' ) AS last_year_time,
    sum( c.out_stock_money ) AS bout_money,
    sum( c.freight_money ) AS bfe_money,
    CONVERT ( sum( c.out_stock_money ) - sum( c.freight_money ), DECIMAL ( 10, 2 ) ) AS last_year_money 
  FROM
    food_orders_info c 
  WHERE
    c.state = 1 
    AND c.order_state = 60 
  GROUP BY
    date_format( DATE_ADD( c.create_time, INTERVAL 1 YEAR ), '%Y-%m' ) 
  ORDER BY
    date_format( DATE_ADD( c.create_time, INTERVAL 1 YEAR ), '%Y-%m' ) ASC 
  ) last_year_sale ON now_sale.now_time = last_year_sale.last_year_time 
ORDER BY
  now_sale.now_year DESC,
  now_sale.now_time ASC

查询得到

20200401134307494.png

month_radio即环比,year_ratio即同比。

按季度统计销售总额、环比

查询季度主要使用 QUARTER ( 时间)函数

方法和按年月统计类似,就直接上sql语句了

#查询当前季度销售总额
SELECT
    date_format( a.create_time, '%Y' ) AS now_year,
    QUARTER ( a.create_time ) a_quarter,
    CONCAT( YEAR ( a.create_time ), QUARTER ( a.create_time ) ) now_quarter,
    sum( a.out_stock_money ) AS a_out_money,
    sum( a.freight_money ) AS a_fre_money,
    CONVERT ( sum( a.out_stock_money ) - sum( a.freight_money ), DECIMAL ( 10, 2 ) ) AS a_sale_money 
  FROM
    food_orders_info a 
  WHERE
    a.state = 1 
    AND a.order_state = 60 
  GROUP BY
    CONCAT( YEAR ( a.create_time ), QUARTER ( a.create_time )),date_format( a.create_time, '%Y' ),  QUARTER ( a.create_time )

QUARTER ( a.create_time ) 指查询当前时间在哪一个季度

20200401134307494.png

查询上一季度销售总额

SELECT
    CONCAT( YEAR ( b.create_time ), QUARTER ( DATE_ADD( b.create_time, INTERVAL 1 QUARTER ) ) ) AS last_quarter,
    sum( b.out_stock_money ) AS b_out_money,
    sum( b.freight_money ) AS b_fre_money,
    CONVERT ( sum( b.out_stock_money ) - sum( b.freight_money ), DECIMAL ( 10, 2 ) ) AS b_sale_money 
  FROM
    food_orders_info b 
  WHERE
    b.state = 1 
    AND b.order_state = 60 
  GROUP BY
  CONCAT( YEAR ( b.create_time ), QUARTER ( DATE_ADD( b.create_time, INTERVAL 1 QUARTER ) ) )   

20200401134307494.png

查询去年同季度销售额

SELECT
    CONCAT(YEAR( DATE_ADD( c.create_time, INTERVAL 1 year )),QUARTER(c.create_time)) as last_year_quarter,
    sum( c.out_stock_money ) AS c_out_money,
    sum( c.freight_money ) AS c_fre_money,
    CONVERT ( sum( c.out_stock_money ) - sum( c.freight_money ), DECIMAL ( 10, 2 ) ) AS c_sale_money 
  FROM
    food_orders_info c 
  WHERE
    c.state = 1 
    AND c.order_state = 60 
  GROUP BY
  CONCAT(YEAR( DATE_ADD( c.create_time, INTERVAL 1 year )),QUARTER(c.create_time)) 

20200401134307494.png

查询本季度、上一季度的销售额,并统计环比

SELECT
  now_quarter_sale.now_year,
  now_quarter_sale.a_quarter,
  now_quarter_sale.now_quarter,
CASE
    WHEN now_quarter_sale.a_sale_money IS NULL 
    OR now_quarter_sale.a_sale_money = 0 THEN
      0 ELSE now_quarter_sale.a_sale_money 
    END this_sale_money,
CASE
    WHEN last_quarter_sale.b_sale_money IS NULL 
    OR last_quarter_sale.b_sale_money = 0 THEN
      0 ELSE last_quarter_sale.b_sale_money 
    END last_sale_money,
CASE
    WHEN last_quarter_sale.b_sale_money IS NULL 
    OR last_quarter_sale.b_sale_money = 0 THEN
      0 ELSE CONVERT ( ( ( now_quarter_sale.a_sale_money - last_quarter_sale.b_sale_money ) / last_quarter_sale.b_sale_money ) * 100, DECIMAL ( 10, 2 ) )
    END last_quarter_ratio 
FROM
  (
  SELECT
    date_format( a.create_time, '%Y' ) AS now_year,
    QUARTER ( a.create_time ) a_quarter,
    CONCAT( YEAR ( a.create_time ), QUARTER ( a.create_time ) ) now_quarter,
    sum( a.out_stock_money ) AS a_out_money,
    sum( a.freight_money ) AS a_fre_money,
    CONVERT ( sum( a.out_stock_money ) - sum( a.freight_money ), DECIMAL ( 10, 2 ) ) AS a_sale_money 
  FROM
    food_orders_info a 
  WHERE
    a.state = 1 
    AND a.order_state = 60 
  GROUP BY
    CONCAT( YEAR ( a.create_time ), QUARTER ( a.create_time )),date_format( a.create_time, '%Y' ),  QUARTER ( a.create_time )
  ) now_quarter_sale
  LEFT JOIN (
  SELECT
    CONCAT( YEAR ( b.create_time ), QUARTER ( DATE_ADD( b.create_time, INTERVAL 1 QUARTER ) ) ) AS last_quarter,
    sum( b.out_stock_money ) AS b_out_money,
    sum( b.freight_money ) AS b_fre_money,
    CONVERT ( sum( b.out_stock_money ) - sum( b.freight_money ), DECIMAL ( 10, 2 ) ) AS b_sale_money 
  FROM
    food_orders_info b 
  WHERE
    b.state = 1 
    AND b.order_state = 60 
  GROUP BY
  CONCAT( YEAR ( b.create_time ), QUARTER ( DATE_ADD( b.create_time, INTERVAL 1 QUARTER ) ) ) 
  ) last_quarter_sale ON now_quarter_sale.now_quarter = last_quarter_sale.last_quarter

20200401134307494.png

最终 ,统计当前季度、上一季度、以及去年同一季度的环比、同比

SELECT
  now_quarter_sale.now_year,
  now_quarter_sale.a_quarter,
  now_quarter_sale.now_quarter,
CASE
    WHEN now_quarter_sale.a_sale_money IS NULL 
    OR now_quarter_sale.a_sale_money = 0 THEN
      0 ELSE now_quarter_sale.a_sale_money 
    END this_sale_money,
CASE
    WHEN last_quarter_sale.b_sale_money IS NULL 
    OR last_quarter_sale.b_sale_money = 0 THEN
      0 ELSE last_quarter_sale.b_sale_money 
    END last_sale_money,
CASE
    WHEN last_quarter_sale.b_sale_money IS NULL 
    OR last_quarter_sale.b_sale_money = 0 THEN
      0 ELSE CONVERT ( ( ( now_quarter_sale.a_sale_money - last_quarter_sale.b_sale_money ) / last_quarter_sale.b_sale_money ) * 100, DECIMAL ( 10, 2 ) )
    END last_quarter_ratio ,
CASE
    WHEN last_year_quarter_sale.c_sale_money   IS NULL 
    OR last_year_quarter_sale.c_sale_money   = 0 THEN
      0 ELSE last_year_quarter_sale.c_sale_money  
    END last_year_money,
CASE
    WHEN last_year_quarter_sale.c_sale_money   IS NULL 
    OR last_year_quarter_sale.c_sale_money   = 0 THEN
      0 ELSE CONVERT ( ( ( now_quarter_sale.a_sale_money - last_year_quarter_sale.c_sale_money ) / last_year_quarter_sale.c_sale_money ) * 100, DECIMAL ( 10, 2 ) )
    END last_year_ratio
FROM
  (
  SELECT
    date_format( a.create_time, '%Y' ) AS now_year,
    QUARTER ( a.create_time ) a_quarter,
    CONCAT( YEAR ( a.create_time ), QUARTER ( a.create_time ) ) now_quarter,
    sum( a.out_stock_money ) AS a_out_money,
    sum( a.freight_money ) AS a_fre_money,
    CONVERT ( sum( a.out_stock_money ) - sum( a.freight_money ), DECIMAL ( 10, 2 ) ) AS a_sale_money 
  FROM
    food_orders_info a 
  WHERE
    a.state = 1 
    AND a.order_state = 60 
  GROUP BY
    CONCAT( YEAR ( a.create_time ), QUARTER ( a.create_time )),date_format( a.create_time, '%Y' ),  QUARTER ( a.create_time )
  ) now_quarter_sale
  LEFT JOIN (
  SELECT
    CONCAT( YEAR ( b.create_time ), QUARTER ( DATE_ADD( b.create_time, INTERVAL 1 QUARTER ) ) ) AS last_quarter,
    sum( b.out_stock_money ) AS b_out_money,
    sum( b.freight_money ) AS b_fre_money,
    CONVERT ( sum( b.out_stock_money ) - sum( b.freight_money ), DECIMAL ( 10, 2 ) ) AS b_sale_money 
  FROM
    food_orders_info b 
  WHERE
    b.state = 1 
    AND b.order_state = 60 
  GROUP BY
  CONCAT( YEAR ( b.create_time ), QUARTER ( DATE_ADD( b.create_time, INTERVAL 1 QUARTER ) ) ) 
  ) last_quarter_sale ON now_quarter_sale.now_quarter = last_quarter_sale.last_quarter
  LEFT JOIN 
  (
SELECT
    CONCAT(YEAR( DATE_ADD( c.create_time, INTERVAL 1 year )),QUARTER(c.create_time)) as last_year_quarter,
    sum( c.out_stock_money ) AS c_out_money,
    sum( c.freight_money ) AS c_fre_money,
    CONVERT ( sum( c.out_stock_money ) - sum( c.freight_money ), DECIMAL ( 10, 2 ) ) AS c_sale_money 
  FROM
    food_orders_info c 
  WHERE
    c.state = 1 
    AND c.order_state = 60 
  GROUP BY
  CONCAT(YEAR( DATE_ADD( c.create_time, INTERVAL 1 year )),QUARTER(c.create_time)) 
  )last_year_quarter_sale  on now_quarter_sale.now_quarter=last_year_quarter_sale.last_year_quarter

20200401134307494.png

last_quarter_ratio = ((this_sale_money-last_sale_money)/last_sale_money)*100%

last_year_ratio = ((this_sale_money-last_year_money)/last_year_money)*100%


界面实现效果:

20200401134307494.png

有兴趣的老爷,可以关注我的公众号【一起收破烂】,回复【006】获取2021最新java面试资料以及简历模型120套哦~

相关实践学习
如何在云端创建MySQL数据库
开始实验后,系统会自动创建一台自建MySQL的 源数据库 ECS 实例和一台 目标数据库 RDS。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助     相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
7月前
|
存储 关系型数据库 MySQL
MYSQL 单表可以放多少数据是怎么计算出来的
MYSQL 单表可以放多少数据是怎么计算出来的
150 1
|
7月前
|
关系型数据库 MySQL 分布式数据库
PolarDB MySQL版标准版计算节点规格详解
PolarDB MySQL版标准版计算节点规格详解
169 1
|
2月前
|
分布式计算 关系型数据库 MySQL
大数据-88 Spark 集群 案例学习 Spark Scala 案例 SuperWordCount 计算结果数据写入MySQL
大数据-88 Spark 集群 案例学习 Spark Scala 案例 SuperWordCount 计算结果数据写入MySQL
52 3
|
2月前
|
存储 监控 关系型数据库
MySQL计算某条数据与上一条数据的生成时间差
MySQL计算某条数据与上一条数据的生成时间差
49 2
|
5月前
|
关系型数据库 MySQL 数据库
MySQL 保姆级教程(八):创建计算字段
MySQL 保姆级教程(八):创建计算字段
|
6月前
|
分布式计算 大数据 关系型数据库
MaxCompute产品使用问题之mysql读取从mc里的每10分钟计算好的结果数据表,如何同步数据过去
MaxCompute作为一款全面的大数据处理平台,广泛应用于各类大数据分析、数据挖掘、BI及机器学习场景。掌握其核心功能、熟练操作流程、遵循最佳实践,可以帮助用户高效、安全地管理和利用海量数据。以下是一个关于MaxCompute产品使用的合集,涵盖了其核心功能、应用场景、操作流程以及最佳实践等内容。
|
6月前
|
存储 SQL 关系型数据库
MySQL快速回顾:计算字段与函数
MySQL快速回顾:计算字段与函数
|
6月前
|
关系型数据库 MySQL Serverless
【随手记】MySQL窗口函数计算累加和
【随手记】MySQL窗口函数计算累加和
495 0
|
7月前
|
关系型数据库 MySQL Unix
MySQL 计算时间差分钟
【5月更文挑战第3天】
142 2
|
6月前
|
关系型数据库 MySQL
Mysql 中位数计算
Mysql 中位数计算
42 0