\$query: SELECT i.items_id,
i.items_name,
i.items_description,
SUM(inv.inventory_quantity),
inv.inventory_delivery,
MAX(inv.inventory_price),
im.images_path
FROM items i, images im, inventory inv, sorts s WHERE (i.items_id = inv.inventory_items_id AND i.items_visibility = 1 AND i.items_images_id = im.images_id AND (s.sorts_id ="118" OR s.sorts_id ="118" OR s.sorts_id ="171" OR s.sorts_id ="172" OR s.sorts_id ="208" OR s.sorts_id ="170" OR s.sorts_id ="173" OR s.sorts_id ="174" OR s.sorts_id ="175") AND s.sorts_id = i.items_sorts_id) GROUP BY i.items_id ORDER BY MAX(inv.inventory_price)