1

Updating a table using join with an other table

Hi there,

according to the manual the trick supposed to work:

http://doc.nuodb.com/Latest/Content/UPDATE.htm

 

But I still can't find a way to do the update using a value from joined table, when my code seems almost identical to the example above:

UPDATE [main table] m
SET m.[field_to_udate] = rf.[Field to map]
WHERE m.criterion1 = 'some value'
and rf.[Some Flag] = 'T'
JOIN [reference table] rf
ON m.[linking_field] = rf.[linking_field]

Getting the error below:

[Code: -1, SQL State: 42000] syntax error on line 5
JOIN [reference table] rf 
^ expected end of statement got JOIN

If I add INNER in the first line straight after "UPDATE [main table] m"  it also throws an error.

 

Could anybody please advise where is my bad, or if there is something with the Nuo? Ideally I need to get the solution with join, as workaround with exists is not such convenient in my case.

 

thanks in advance,

Sergey.

1 comment

Please sign in to leave a comment.