select * from product_pics where productid in () order by productid asc, numa desc,id asc
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ') order by productid asc, numa desc,id asc' at line 1