Skip to content

Instantly share code, notes, and snippets.

@GreatPotato
Last active December 15, 2015 19:18
Show Gist options
  • Save GreatPotato/5309994 to your computer and use it in GitHub Desktop.
Save GreatPotato/5309994 to your computer and use it in GitHub Desktop.
LemonStand average shipping quote per country
SELECT t2.name AS 'Country name', ROUND(AVG(t1.shipping_quote), 2) AS 'Average shipping price'
FROM shop_orders t1
LEFT JOIN shop_countries t2
ON t1.shipping_country_id = t2.id
WHERE t1.status_id != 1
GROUP BY(t2.name)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment