Question

UPDATE job_details 
    WHERE assigned AS +1 
    WHEN assigned is NULL 
    WHEN student_details.jobscope = job_details.jobscop 
    AND student_details.jobscope1 ='IT'

Is this query right? My motive is to get the assigned row in the database to (+1) each time a student is assigned to a job with a jobscope of IT.

Était-ce utile?

La solution

Try

UPDATE job_details 
JOIN student_details ON student_details.jobscope = job_details.jobscop
SET assigned = (assigned+1) 
WHERE  student_details.jobscope1 ='IT'
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top