时间:2021-07-01 10:21:17 帮助过:13人阅读
建表命令:
CREATE TABLE `t_sold_order` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`dt` date DEFAULT NULL COMMENT ‘日期‘,
`hour` tinyint(2) DEFAULT ‘0‘ COMMENT ‘小时‘,
`hour_order` int(11) DEFAULT ‘0‘ COMMENT ‘小时订单数‘,
`total_order` int(11) DEFAULT ‘0‘ COMMENT ‘总的订单数‘,
`prediction` int(11) DEFAULT ‘0‘ COMMENT ‘预测订单数‘,
PRIMARY KEY (`id`),
UNIQUE KEY `dt_hour` (`dt`,`hour`)
) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8
COMMENT=‘实时订单数‘
表操作命令:
复制表结构:create table table1 like table;
复制数据:insert into table1 select * from table
机器授权:
grant select on *.* to ‘reader‘@‘%‘ identified by ‘123456‘ WITH
GRANT OPTION
flush privileges
查询数据直接插入
insert into t_visual_user_domain(`user_id`,`domain`,`group`) select
id,‘www.baidu.com‘ as domain,`group` from t_visual_user;
修改表结构
alter table competitor_goods add sku_id bigint(20) unsigned DEFAULT
NULL COMMENT ‘商品销售码‘;
MySQL 查看表结构简单命令
标签:创建 create tiny http read use 分享 img select