SNS Property Finance (formerly Bouwfonds)
Unknown column 'r2.object_id' in 'on clause'
SELECT relobj.*, r2.role, sp.site_id, f.filename, f.id 'file_id', f.source_id FROM ws_objects_rel r1, ws_objects_rel r2, ws_objects relobj, ws_sites_publish sp LEFT JOIN ws_files_rel fr ON fr.object_id = r2.object_id LEFT JOIN ws_files f ON f.id = fr.file_id WHERE r1.object_id = 10099 AND r2.relnum = r1.relnum AND r2.object_id != r1.object_id AND relobj.id = r2.object_id AND relobj.publish = '1' AND relobj.type_id IN (2) AND sp.object_id = relobj.id AND sp.site_id = 1 GROUP BY r1.object_id, r2.object_id ORDER BY r2.priority ASC LIMIT 0,100