0

I have problem with my SQL Server query:

UPDATE latihan AS t1 ,
       (SELECT Equipment, system_status, functloc 
        FROM latihan 
        WHERE system_status='ESTO') AS t2 
SET t1.functloc = t2.functloc
WHERE t1.supereq = t2.equipment

I just want update the functloc on equipment based functloc on supereq.

The error is:

[Err] 42000 - [SQL Server]Incorrect syntax near the keyword 'AS'.
42000 - [SQL Server]Incorrect syntax near the keyword 'AS'.

0

1 Answer 1

1

I think you want something like this:

update t1 set
  functloc = t2.functloc
from latihan t1
inner join (
  select Equipment, system_status, functloc
  from latihan
  where system_status='ESTO'
) t2 on t2.equipment = t1.supereq
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.