I\'ve got some SQL that used to work with an older MySQL version, but after upgrading to a newer MySQL 5 version, I\'m getting an error. Here\'s the SQL:
SELECT
The way you have written the query, the compiler thinks you want to left join portfolio to types, so it complains that your on clause references the projects table.
Try this ANSI-style version:
SELECT *
FROM projects p
inner join types t on p.projectType = t.typeID AND t.typeID = #URL.a#
LEFT JOIN portfolio pf ON pf.pfProjectID = p.projectID
ORDER BY t.typeSort, p.projectPriority