查看表分区:show partitions tableName;
删除表分区:alter table tableName drop partition (pdt='表分区');
时间新增秒(新增一小时):from_unixtime(UNIX_TIMESTAMP('2022031423','yyyyMMddHH') 3600, 'yyyy-MM-dd HH:mm:ss')
时间格式化:select from_unixtime(UNIX_TIMESTAMP('2022-03-23 04:10','yyyy-MM-dd HH:mm'), 'yyyyMMddHH')
case when 示例
代码语言:javascript复制select CASE
WHEN dosage_type='1' THEN '1'
when dosage_type='2' THEN '2'
when dosage_type='3' THEN '3'
when dosage_type='4' THEN '4'
when dosage_type='5' THEN '5' END as columtest
from tablename;
修改表字段
代码语言:javascript复制alter table 表名 change column 原字段名称 新字段名称 新字段类型