Database Error

Error message returned from the database:

Could not execute query [Native Error: 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 'as valueID FROM SpecificationDateValue LEFT JOIN SpecField ON specFieldID ' at line 1] [User Info: SELECT SpecificationDateValue.*, NULL AS valueID, NULL AS specFieldValuePosition, SpecFieldGroup.position AS SpecFieldGroupPosition, SpecFieldGroup.name AS SpecFieldGroupName, SpecField.* as valueID FROM SpecificationDateValue LEFT JOIN SpecField ON specFieldID = SpecField.ID LEFT JOIN SpecFieldGroup ON SpecField.specFieldGroupID = SpecFieldGroup.ID WHERE productID IN (2624, 7918, 9106, 9182, 9183, 9185, 9186, 9187, 9188, 9190, 9191, 9346, 9377, 9479, 9480) AND SpecField.isDisplayedInList = 1 UNION SELECT SpecificationStringValue.*, NULL, NULL AS specFieldValuePosition, SpecFieldGroup.position AS SpecFieldGroupPosition, SpecFieldGroup.name AS SpecFieldGroupName, SpecField.* as valueID FROM SpecificationStringValue LEFT JOIN SpecField ON specFieldID = SpecField.ID LEFT JOIN SpecFieldGroup ON SpecField.specFieldGroupID = SpecFieldGroup.ID WHERE productID IN (2624, 7918, 9106, 9182, 9183, 9185, 9186, 9187, 9188, 9190, 9191, 9346, 9377, 9479, 9480) AND SpecField.isDisplayedInList = 1 UNION SELECT SpecificationNumericValue.*, NULL, NULL AS specFieldValuePosition, SpecFieldGroup.position AS SpecFieldGroupPosition, SpecFieldGroup.name AS SpecFieldGroupName, SpecField.* as valueID FROM SpecificationNumericValue LEFT JOIN SpecField ON specFieldID = SpecField.ID LEFT JOIN SpecFieldGroup ON SpecField.specFieldGroupID = SpecFieldGroup.ID WHERE productID IN (2624, 7918, 9106, 9182, 9183, 9185, 9186, 9187, 9188, 9190, 9191, 9346, 9377, 9479, 9480) AND SpecField.isDisplayedInList = 1 UNION SELECT SpecificationItem.productID, SpecificationItem.specFieldID, SpecFieldValue.value, SpecFieldValue.ID, SpecFieldValue.position, SpecFieldGroup.position AS SpecFieldGroupPosition, SpecFieldGroup.name AS SpecFieldGroupName, SpecField.* FROM SpecificationItem LEFT JOIN SpecFieldValue ON SpecificationItem.specFieldValueID = SpecFieldValue.ID LEFT JOIN SpecField ON SpecificationItem.specFieldID = SpecField.ID LEFT JOIN SpecFieldGroup ON SpecField.specFieldGroupID = SpecFieldGroup.ID WHERE productID IN (2624, 7918, 9106, 9182, 9183, 9185, 9186, 9187, 9188, 9190, 9191, 9346, 9377, 9479, 9480) AND SpecField.isDisplayedInList = 1 ORDER BY productID, SpecFieldGroupPosition, position, specFieldValuePosition]