SELECT * FROM firms as f #, firmsReg as fR WHERE f.id!=314 #AND f.id=fR.id ORDER BY f.status DESC,f.rate DESC LIMIT 2615,5