An Error Was Encountered

Error Number: 1064

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 ') WHERE f.category_id=1 Order By f.sorder' at line 1

SELECT f.id, IF(LENGTH(sf.name) > 0,sf.name,f.name) as name, f.sd, f.sorder, f.notes, f.category_id, sf.category_id as sf_category_id, sf.sheet_id, sf.bold FROM cms_fm_features as f LEFT JOIN cms_fm_sheetfeature as sf ON (f.id = sf.feature_id AND sf.sheet_id = ) WHERE f.category_id=1 Order By f.sorder