zoukankan      html  css  js  c++  java
  • 临时脚本20200802

    -- drop table poms_status;

    CREATE TABLE `poms_status` (
    `id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT 'ID',
    `mid` varchar(64) NOT NULL COMMENT '传感器编码',
    `receive_time` varchar(255) DEFAULT NULL COMMENT '接收数据时间,格式hh:mm:ss',
    `val1` double DEFAULT NULL COMMENT '记录值1',
    `val2` double DEFAULT NULL COMMENT '记录值2',
    `val3` double DEFAULT NULL COMMENT '记录值3',
    `val4` double DEFAULT NULL COMMENT '记录值4',
    `product` varchar(255) DEFAULT NULL COMMENT '产品',
    `paint` varchar(255) DEFAULT NULL COMMENT 'paint',
    `line` varchar(255) DEFAULT NULL COMMENT 'line',
    `receive_date` varchar(255) NOT NULL COMMENT '接收数据日期,格式:yyyy-mm-dd',
    `status` smallint(6) DEFAULT NULL COMMENT '状态,1:正常,2:报警',
    `warn_info` varchar(500) DEFAULT NULL COMMENT '报警说明',
    `type` varchar(64) DEFAULT NULL COMMENT '传感器类型',
    PRIMARY KEY (`id`,`receive_date`),
    KEY `INX01` (`mid`,`receive_time`)
    ) ENGINE=MyISAM AUTO_INCREMENT=750943 DEFAULT CHARSET=utf8 COMMENT='传感器状态'
    partition by range COLUMNS(`receive_date`)
    (PARTITION p20200801 VALUES LESS THAN ('2020-08-01') ,
    PARTITION p20200802 VALUES LESS THAN ('2020-08-02') ,
    PARTITION p20200803 VALUES LESS THAN ('2020-08-03'),
    PARTITION p20200804 VALUES LESS THAN ('2020-08-04'),
    PARTITION p20200805 VALUES LESS THAN ('2020-08-05'),
    PARTITION p20200806 VALUES LESS THAN ('2020-08-06'),
    PARTITION p20200807 VALUES LESS THAN ('2020-08-07'),
    PARTITION p20200808 VALUES LESS THAN ('2020-08-08'),
    PARTITION p20200809 VALUES LESS THAN ('2020-08-09'),
    PARTITION p20200810 VALUES LESS THAN ('2020-08-10'),
    PARTITION p20200811 VALUES LESS THAN ('2020-08-11'),
    PARTITION p20200812 VALUES LESS THAN ('2020-08-12'),
    PARTITION p20200813 VALUES LESS THAN ('2020-08-13'),
    PARTITION p20200814 VALUES LESS THAN ('2020-08-14'),
    PARTITION p20200815 VALUES LESS THAN ('2020-08-15'),
    PARTITION p20200816 VALUES LESS THAN ('2020-08-16'),
    PARTITION p20200817 VALUES LESS THAN ('2020-08-17'),
    PARTITION p20200818 VALUES LESS THAN ('2020-08-18'),
    PARTITION p20200819 VALUES LESS THAN ('2020-08-19'),
    PARTITION p20200820 VALUES LESS THAN ('2020-08-20'),
    PARTITION p20200821 VALUES LESS THAN ('2020-08-21'),
    PARTITION p20200822 VALUES LESS THAN ('2020-08-22'),
    PARTITION p20200823 VALUES LESS THAN ('2020-08-23'),
    PARTITION p20200824 VALUES LESS THAN ('2020-08-24'),
    PARTITION p20200825 VALUES LESS THAN ('2020-08-25'),
    PARTITION p20200826 VALUES LESS THAN ('2020-08-26'),
    PARTITION p20200827 VALUES LESS THAN ('2020-08-27'),
    PARTITION p20200828 VALUES LESS THAN ('2020-08-28'),
    PARTITION p20200829 VALUES LESS THAN ('2020-08-29'),
    PARTITION p20200830 VALUES LESS THAN ('2020-08-30'),
    PARTITION p20200831 VALUES LESS THAN ('2020-08-31')
    );


    alter table poms_status add partition(partition p20200901 VALUES LESS THAN ('2020-09-01') ENGINE = MyISAM);

    alter table poms_status add partition(partition p20200902 VALUES LESS THAN ('2020-09-02') ENGINE = MyISAM);


    SELECT PARTITION_NAME, TABLE_ROWS FROM INFORMATION_SCHEMA.PARTITIONS WHERE TABLE_NAME = 'poms_status';

  • 相关阅读:
    汇编--立即数
    java mysql常用函数大全
    java springboot@GeneratedValue 注解
    java list.stream().map().collect(Collectors.toList())
    java 一种树的写法
    怎么查看当前进程?怎么执行退出?怎么查看当前路径?
    垃圾回收的优点和原理,并考虑2种回收机制?
    du 和 df 的定义,以及区别?
    通过什么命令查找执行命令?
    终端是哪个文件夹下的哪个文件?黑洞文件是哪个文件夹下的哪个命令?
  • 原文地址:https://www.cnblogs.com/abingtech/p/13420271.html
Copyright © 2011-2022 走看看