Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

sqlite update where exists

UPDATE employees
SET hire_date = (SELECT departments.start_date
                 FROM departments
                 WHERE departments.department_id = employees.department_id
                 AND departments.department_name = 'HR')
WHERE EXISTS (SELECT *
              FROM departments
              WHERE departments.department_id = employees.department_id
              AND departments.department_name ='HR');
Source by www.techonthenet.com #
 
PREVIOUS NEXT
Tagged: #sqlite #update #exists
ADD COMMENT
Topic
Name
9+6 =