
January 8th, 2009, 04:57 PM
|
|
Registered User
|
|
Join Date: Jan 2009
Posts: 1
Time spent in forums: 1 m 53 sec
Reputation Power: 0
|
|
|
UPDATE using a JOIN
Hi,
The update statement below:
UPDATE tblFolderReport SET ParentID = 1, UpdateTime = '2009-01-08 14:10:05' FROM tblFolderReport a, tblScheduleInstance b, tblSchedulePackage c, tblSchedule d WHERE a.ReportTemplateID = 2 AND a.ManagerInstance = 0 AND b.ReportID = a.ReportID AND ((c.SchedulePackageID = b.SchedulePackageID AND c.Burst = 1) OR (b.SchedulePackageID = 0 AND d.ScheduleID = b.ScheduleID AND d.Burst = 1))
generates the following MySql error:
ERROR [42000] [MySQL][ODBC 5.1 Driver][mysqld-5.0.51b-community-nt]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM tblFolderReport a, tblScheduleInstance b, tblSchedulePackage c, tblSchedule'
I am trying to rewrite the UPDATE statement using JOIN ON but cannot get the syntax right.
Your help is greatly appreciated.
Ronny
|