1. 程式人生 > >vertica從其它表遷移數據到新表(insert into 語句使用方法實例)

vertica從其它表遷移數據到新表(insert into 語句使用方法實例)

clas -h 語句 use desc lower weibo name pos

版權聲明:本文為博主原創文章。博主同意自由轉載。 https://blog.csdn.net/tx18/article/details/26585649

#例:遷移微博用戶數據。

因為源表weiboFriend與目標表weiboUser的表結構不全然同樣,因此在語句不但要嚴格排列字段順序,並且還要用缺省值(如:‘‘ 等)補齊源表中沒有的字段值

詳細SQL語句:

insert ?into public.weiboUser ( id,screen_name,location,description,profile_image_url,blog_url,followers_count,statuses_count,created_at ) ( select uid,screen_name,‘‘,‘‘,profile_image_url,‘‘,followers_count,statuses_count,created from public.weiboFriend );

大家能夠依據實際情況稍加改動後使用

vertica從其它表遷移數據到新表(insert into 語句使用方法實例)