Skip to content
Advertisement

INSERT ‘X’ If another column is updated

I need to update column firstname in table Taulu ( removing single quotes ). I also need to add ‘X’ to another column sq if values where updated.
I would like to update this in one statement.

What I tried so far:

Advertisement

Answer

Something like this, I think:

The WHERE clause should identify only the rows that will be updated (those with single quotes). I’m not sure if the assignment to sq should be a simple assignment or sq = sq + 'X'.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement