sql update table set - The multi-part identifier could not be bound

前端 未结 2 1011
傲寒
傲寒 2021-01-05 02:18

I have 2 tables:

  • Table1 = names of gas stations (in pairs)
  • Table2 = has co-ordinate information (longitude and latit
2条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-05 02:59

    I think you can modify your UPDATE statement to reference the table alias in the UPDATE line.

    update t1
    set t1.[Lattitude1] = t2.[Lattitude]
    from table1 t1
    left join table2 t2 
    on (t1.StationID1 = t2.IDInfo)
    

提交回复
热议问题