danielsmeyer
4/14/2020 - 3:21 PM

Spotify Costs

select
	country,
	ean,
	isrc,
	title,
	artist,
	count,
	total,
	total * 0.985 as percent
from
(
	select
		"Country" as country,
		"EAN" as ean,
		"ISRC" as isrc,
		min("Track name") as title,
		min("Artist name") as artist,
		sum("Quantity") as count,
		sum("Payable") as total
	from spotify_costs
	where "Payable currency" like 'USD'
	group by
		country,
		ean,
		isrc
	
) as t