Optimize the sql query

Posted by joseph on Stack Overflow See other posts from Stack Overflow or by joseph
Published on 2010-03-19T09:38:01Z Indexed on 2010/03/19 9:41 UTC
Read the original article Hit count: 440

Filed under:
|

UPDATE employees SET job_id = (SELECT job_id FROM employees WHERE employee_id = 205), salary = (SELECT salary FROM employees WHERE employee_id = 205) WHERE employee_id = 114;

This is the query i have been using. Here i use 2 subqueries but they have the same where condition.. The seek time is doubled.. Is there a way to optimize the whole query to a single subquery?

Thanks in advance

© Stack Overflow or respective owner

Related posts about sql

Related posts about Oracle