QUERY: SELECT count(*) Cnt FROM product a right join productCatesort b on a.productNo=b.productNo WHERE (status=1 Or status=4) AND (start_date <= now() Or start_date is null Or start_date = '0000-00-00') And (end_date >= now() Or end_date is null Or end_date = '0000-00-00') and b.CatNo= order by b.priority DESC
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 'order by b.priority DESC' at line 1