-- 3.
UPDATE upd_tab
SET col = data_tab.col
FROM data_tab
WHERE data_tab.code = my_alias.code
Question withdrawn. It was an error in my logic, whereas
the syntax is quite clear. The simplest UPDATED from another
table does *not* requre that it the table begin updated be
mentioned in the FROM clause:
UPDATE upd_tab
SET col = data_tab.col
FROM data_tab
WHERE data_tab.code = upd_tab.code
The simplest UPDATE from another table does *not* requre
that it the table begin updated be mentioned in the FROM
clause:
UPDATE upd_tab
SET col = data_tab.col
FROM data_tab
WHERE data_tab.code = upd_tab.code
Whereas this is legal and produces something, I definitely
recommend against it. I will have to admit that I don't
understand what this is doing - and I certainly play an
SQL expert on TV.
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 296 |
Nodes: | 16 (2 / 14) |
Uptime: | 84:15:22 |
Calls: | 6,658 |
Calls today: | 4 |
Files: | 12,203 |
Messages: | 5,333,601 |
Posted today: | 1 |