1
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.

Styphon
  • 10,304
  • 9
  • 52
  • 86
Angelica
  • 55
  • 1
  • 1
  • 9
  • Not in proper format. `SET` is the first thing that is missing – Hanky Panky Jan 16 '14 at 14:18
  • Try running the query on the database but rolling back the changes in order to prevent any issues. You can use SQL transactions for that. http://stackoverflow.com/questions/20051957/testing-mysql-query – Chris Bier Jan 16 '14 at 14:20

1 Answers1

0

Try

UPDATE job_details 
JOIN student_details ON student_details.jobscope = job_details.jobscop
SET assigned = (assigned+1) 
WHERE  student_details.jobscope1 ='IT'
Nouphal.M
  • 6,304
  • 1
  • 17
  • 28