[英]Finding connection between two tables and copying one tables data to another table with different column name and same data
我有兩個表我想檢查兩個表之間的連接路徑(數據庫鏈接)並將一個表數據復制到另一個具有不同列名和相同數據的表
您提到了數據庫鏈接; 當模式駐留在不同的數據庫中時使用它。 因此,您首先必須創建一個數據庫鏈接(如果它尚不存在),然后
insert into table_b@db_link (username, age, dob)
select name, age, dob
from table_a;
否則,如果模式駐留在同一個數據庫中,您只需將某些權限從用戶(擁有表 B)授予用戶(擁有表 A):
connect user_b
grant insert on table_b to user_a
connect user_a
insert into user_b.table_b (username, age, dob)
select name, age, dob
from table_a;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.