Get all customers who bought for more then 50 Euro

Hi,

With the christmas time at the door, its time to greet the customers :wink:

Is there a way to get a list of the customers together with a sum of their order values, preferrably sorted by their order values? Preferrably in oxid admin interface, but SQL statement would do it too.

Best
Petr

This could do it:

SELECT oxfname, oxlname, oxstreet, oxstreetnr, oxzip, oxcity
FROM oxuser as a
JOIN
(
SELECT oxtotalbrutsum as summy, oxuserid as oxuserid
FROM oxorder as b 
WHERE oxtotalordersum >= 50
group by oxuserid
) b ON a.oxid = b.oxuserid

Thanks!

I modified it a bit to get also the country

SELECT oxfname, oxlname, oxstreet, oxstreetnr, oxzip, oxcity, c.oxtitle, summy
FROM oxuser as a
JOIN
(
SELECT oxtotalordersum as summy, oxuserid as oxuserid
FROM oxorder as b
WHERE oxtotalordersum >= 50
group by oxuserid
) b ON a.oxid = b.oxuserid
join oxcountry c on a.oxcountryid = c.oxid