samedi 9 juillet 2016

Using the Concat expression with a join

I'm trying to append the names of a number of fields with certain criteria.

This works fine:

select * from course
left join courseterm on course.courseID = CourseTerm.courseID
where courseterm.termID like 1 or 2
and course.expires not like '0000-00-00 00:00:00'

This also works fine:

UPDATE course SET course.Title = CONCAT(`Title`, ' ');

However, this tells me that I have an error in my syntax:

update course
set course.title = CONCAT('2015/2016-',`Title`)
left join courseterm on course.courseID = CourseTerm.courseID
where courseterm.termID like 1 or 2
and course.expires not like '0000-00-00 00:00:00';

I can't figure out what's wrong. Anyone?

Aucun commentaire:

Enregistrer un commentaire