I have two tables:

* *NewData*:

```
EName               Job        Sal

smith               clerk      2000
allen               sales      2000
jones.domain.com    Manager    6000

```
* *OldData*:

```
EMPNO        ENAME                  JOB         HIREDATE       SAL

7369         smith.domain.com       clerk       17-DEC-80      1300
7549         allen.domain.com       sales       01-JAN-81      1800
7645         jones.domain.com       Manager     01-JAN-80      5000

```

I want to update columns *Job* and *Sal* of the table *OldData* from table *NewData* by using column *EName*. I tried it with `LIKE` and `SUBSTR` but not getting a good solution using them.

LIKE query-
UPDATE emp\_backup
SET emp\_backup.sal = (select t1.sal from t1 join emp\_backup on t1.ename like emp\_backup.ename+'%')

SUBSTR query-
UPDATE emp\_backup
SET emp\_backup.sal = (select t1.sal from t1 join emp\_backup on SUBSTR(t1.ename,1,4)=SUBSTR(emp\_backup.ename,1,4));