An odd question here. I can't for the life of me figure out how to do this query. I think it involves self-joins or something. I'd like an orders table sorted by the customers who spend the most money first. The catch? I still want to see each order. A sample table and desired output query can be found here:
Sort by customer who spends the most money first.
Sort by each customer's *individual* order total second.
Customer 2 has spent the most money with us ($1938),
so we list his orders first, in descending order.
To be honest, it seems a little pointless, but sometimes that's just how people want the data. Oh, and I would like to not have to use stored procs, because I may have to use this in another DB at some point.