填补职位?

时间:2014-01-16 14:16:46

标签: php database matching

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

这个查询对吗? 我的动机是每次将学生分配到具有IT工作范围的工作时,将数据库中指定的行(+1)。

1 个答案:

答案 0 :(得分:0)

尝试

UPDATE job_details 
JOIN student_details ON student_details.jobscope = job_details.jobscop
SET assigned = (assigned+1) 
WHERE  student_details.jobscope1 ='IT'