sql复制列

    技术2022-05-11  85

    假设有表A,B,它们通过A.join与B.join一一对应 现在要实现把A表的id复制为B表的一列的内容update A set A.id=(select from A,B where A.join=B.join)where exsit (select 1 from A,B where A.join=B.join)

    另外:插入列的方法insert into table1(column_name) select column_name from table2将table2表中的colnmu_name的内容插入到表table1的column_name 


    最新回复(0)