Hi,

I have an invoicing system using postgresql. Each time a customer makes a purchase, a 
new record is inserted into the "cart" table. The "cart" table, among other things, 
contains a customer_id field and a total for the amount purchased on the particular 
invoice. Now what I'd like to do is to calculate the total invoices for each customer 
in a given time interval, then list those customers in descending order from most 
paying to least paying. Could someone give me some pointers on how to construct an sql 
statement that would flush out this data.

Thanks for your help,

Mark

---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
      joining column's datatypes do not match

Reply via email to