I have a database table like below.

Here I am using group by on parent_sku column. Here is my query and its result.

SELECT
domain,
parent,
parent_name,
parent_sku,
SUM(qty) AS sales,
SUM(gross) AS revenue,
SUM(net) AS net_revenue,
SUM(refund_qty) AS returns,
created_at
FROM report_byproducts_name
GROUP BY parent_sku
ORDER BY sales DESC
LIMIT 50
But I want to give priority for the domain name. Like if I give priority to themusthaves domain then it should give the result as domain = themusthaves and parent = 450212 with the same group by.
Currently, I am always getting domain=tmhde and parent=325227
Note: Please ignore created_at column
Any suggestions will be appreciated
Thanks
Here I am adding SQL Fiddle

group bymultiple columns, then add multiple columns to yourgroup by, separated by commas.salescolumn?parent_sku. Please fix this problem first before proceeding.