[SQL] Aggregate Aggravation

2001-09-27 Thread Robin's PG-SQL List
I have a query using the SUM() function that is not returning the appropriate results. There are 3 queries with results below. Query 1 is the type of query I'd like to use, that has the SUM() function and a join with a customer table (bolcustomer) to constrain the results to a particular custo

Re: [SQL] Aggregate Aggravation

2001-09-27 Thread Tom Lane
"Robin's PG-SQL List" <[EMAIL PROTECTED]> writes: > I have a query using the SUM() function that is not returning the > appropriate results. I'm guessing that you have two rows in bolcustomer matching bol_number = 88738, so that the 14 gets added in twice. regards, tom l

Re: [SQL] Aggregate Aggravation

2001-10-02 Thread Robin's PG-SQL List
Indeed I do. I need to add another constraint on that query. It never would have occurred to me had I not asked. Problem solved. Thank you, thank you! -Robin On Thu, 27 Sep 2001, Tom Lane wrote: > "Robin's PG-SQL List" <[EMAIL PROTECTED]> writes: > > I have a query using the SUM() function