copy one column from one table to another

后端 未结 2 1441
傲寒
傲寒 2021-02-01 04:30

I am confused about how to copy a column from one table to another table using where. I wrote SQL query but it says transaction lock time exceeded or query returns more than one

2条回答
  •  执笔经年
    2021-02-01 04:56

    There are two options here:

    1. update your tables to use BuildID as a primary key (to avoid duplicates)
    2. update your subquery to only return one result

      UPDATE results SET results.platform_to_insert = (
          SELECT correct_platform
          FROM build
          WHERE results.BuildID=build.BuildID LIMIT 1
      );
      

提交回复
热议问题