samedi 23 juillet 2016

mysql select max & group by

http://i64.tinypic.com/wb7y2b.png that's my table

how do that? i try that and it gives only 1 max exp1 result...

   "SELECT * FROM table1
WHERE (product_id=$id AND group=1) OR
 (product_id=$id AND group=1) OR
 (product_id=$id AND group=4) OR
 (product_id=$id AND group=7)
GROUP BY group"

Aucun commentaire:

Enregistrer un commentaire