1)、----CAST和CONVERT的用法
SQL中的cast和convert都是用来将一种数据类型的表达式转换为另一种数据类型的表达式。
CAST和CONVERT提供相似的功能,只是语法不同。
在时间转化中一般用到convert,因为它比cast多加了一个style,可以转化成不同时间的格式。
使用 CAST:
CAST ( expression AS data_type )
使用 CONVERT:
CONVERT (data_type[(length)], expression [, style])
2)、-----修改表test的字段 a 为 a1 类型为 int
ALTER TABLE test_change CHANGE a a1 INT;
ALTER TABLE dm_pquser_exception_detail_d CHANGE id id string;
3)、-----hive sql增加字段
alter table dm_highrail_sector_lte_new_d add columns(kqi_httpwebrspdelay bigint,kqi_httpwebcmpltdelay bigint,kqi_thrput bigint,kqi_stallfrequ bigint,kqi_imsentrate bigint)
4)、-----gbase sql增加字段
alter table dm_poor_ne_1800_index_d add app_score double
5)、----查看分区
show partitions lte_netmaxl_nbi_covergrid;
6)、----删除表分区
alter table cfg_sector_c drop partition(p_provincecode=510000,p_date='2017-05-01')
<