select id,header,pic_have,price,amount,onorder,route,old_price from catalog_products where status=1 and `not_prod`='0' and amount>0 and cat_id in () and id!='587' order by rand() limit 4

Error in query.