vertica从其它表迁移数据到新表(insert into 语句使用方法实例)

版权声明:本文为博主原创文章。博主同意自由转载。 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 );

大家能够依据实际情况稍加改动后使用

posted on 2019-04-06 17:39  xfgnongmin  阅读(779)  评论(0编辑  收藏  举报

导航