hive删除表语句
-- 刪除庫
drop database if exists db_name;
-- 強制刪除庫
drop database if exists db_name cascade;-- 刪除表
drop table if exists employee;-- 清空表
truncate table employee;
-- 清空表,第二種方式
insert overwrite table employee select * from employee where 1=0; -- 刪除分區(qū)
alter table employee_table drop partition (stat_year_month>='2018-01');-- 按條件刪除數(shù)據(jù)
insert overwrite table employee_table select * from employee_table where id>'180203a15f';
總結(jié)
- 上一篇: 混合改进策略的黑猩猩优化算法
- 下一篇: 超简单的倒计时代码编写