\$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 ="160" OR s.sorts_id ="160" OR s.sorts_id ="164" OR s.sorts_id ="165" OR s.sorts_id ="163" OR s.sorts_id ="460" OR s.sorts_id ="161" OR s.sorts_id ="162" OR s.sorts_id ="461" OR s.sorts_id ="462" OR s.sorts_id ="463" OR s.sorts_id ="464" OR s.sorts_id ="465" OR s.sorts_id ="466" OR s.sorts_id ="467") AND s.sorts_id = i.items_sorts_id) GROUP BY i.items_id ORDER BY MAX(inv.inventory_price)