Skip to content
Advertisement

Using Right() or Substr() in an UPDATE statement

I have two tables :

Second Table :

I need to update the field HC_ID of Add_T Table and I use the following SQL statement:

It doesn’t work. Also, I used the right() function and also got incorrect results.

Could anyone say where is the mistake?

Advertisement

Answer

Looks like you need the last 4 characters of a string. If so, then you’d

because e.g.

(Note also that you’d enclose strings into single quotes in Oracle, not double ones (as you tried with the "-LOC" string).

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