Query gave an error


select DescriptionShort,ImageDate,Title,id from binarys left join BinaryIdJoinId on BinaryIdJoinId.binaryid=binarys.id and BinaryIdJoinId.JoinId= where binarys.JoinId= order by if(DescriptionShort<>'',0,1),if(Title<>'',0,1),SortOrder

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 binarys.JoinId= order by if(DescriptionShort<>'',0,1),if(Title<>'',0,1),So' at line 1