CREATE EXTERNAL TABLE tmp_v1.tmp_zdh_test_biz_cms_flow_tmp_v4( dt string, dn BIGINT, addtime BIGINT , adduser string, innercode string, url string, title string, original BIGINT, timestamp TIMESTAMP, pv BIGINT, uv BIGINT ) ROW FORMAT DELIMITED FIELDS TERMINATED BY ',' ;
处理语句
insert overwrite table tmp_v1.tmp_zdh_test_biz_cms_flow_tmp_v4 select from_unixtime(unix_timestamp(dt,'yyyyMMdd'),'yyyy-MM-dd') as dt,case dn when 'acc' then 1 when 'jianshe' then 2 when 'med' then 3 else 4 end as dn1,addtime,adduser,innercode,url,title,cast(original as bigint ),from_unixtime(unix_timestamp(),'yyyy-MM-dd HH:mm:ss'),cast(pv as bigint),cast(uv as bigint) from adm_v1.adm_cms_flow_daily where dn='acc' and dt='20201110' and addtime='20201110' ;
问题展示
原表中的original 字段 存在 1 的值 导入到tmp_v1.tmp_zdh_test_biz_cms_flow_tmp_v4表之后 original 字段变为null 值
本文介绍了在使用Laravel和sqlsrv连接到SQL Server 2016时,如何在插入查询中使用输出子句,并返回所需的值。同时讨论了使用CreatedOn字段返回最近创建的行的解决方法以及使用Eloquent模型创建后,值正确插入数据库但没有返回uniqueidentifier字段的问题。最后给出了一个示例代码。 ...
[详细]