其他分享
首页 > 其他分享> > vertica从其它表迁移数据到新表(insert into 语句使用方法实例)

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

作者:互联网

#例:迁移微博用户数据。

因为源表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 );

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

标签:count,insert,vertica,url,into,语句,weiboFriend,statuses
来源: https://www.cnblogs.com/xfgnongmin/p/10662348.html