I have two tables in both tables have a BSONUM column, I need to update table1 column REIS if in both tables BSONUM = BSONUM
made a query in SQL Server but does not work
I have two tables in both tables have a BSONUM column, I need to update table1 column REIS if in both tables BSONUM = BSONUM
made a query in SQL Server but does not work
You can do join
& always define table alias:
update t
set t.reis_t = s.reis
from ticket t inner join
segements s
on s.bsonum = t.bsonum;
Apperently there is ambiguity in the column name BSONUM
Have you tried doing WHERE FirstTable.BSONUM = SecondTable.BSONUM
If you have two columns with the same name from two tables the engine has issue understanding which one you are referring to. Thus, you need to specify table name as well.