I am trying to create a sql statement to update a record set when a certain condition is true. example:
table A contains username (key), status
table B contains username (key), number1, number2
update should do something like this:
update B set B.number1, B.number2 (values 1, 1) when A.username = B.username and A.status = "MED"
I have tried all sort of combination of joins but all fail. Can anyone give me a correct SQL statement?