Re: [PHP-DB] Query Sum problem

2003-12-16 Thread CPT John W. Holmes
From: "Larry Sandwick" <[EMAIL PROTECTED]> > I appreciate the quick response, but I should have been more clear. > > I understand the query below, but I would only have 2 total and it is > not group by the companies. > > The query below gives me the main information without totals. > > How do I ad

Re: [PHP-DB] Query Sum problem

2003-12-16 Thread CPT John W. Holmes
From: "Larry Sandwick" <[EMAIL PROTECTED]> > I need to sum the field *COST* in this query where data in *STATUS* is > equal to "HELD" and "OPEN", so I will have 2 totals passed below and do > not know where to begin . SELECT status, SUM(cost) FROM Table WHERE status IN ('HELD','OPEN') GROUP BY sta

[PHP-DB] Query Sum problem

2003-12-16 Thread Larry Sandwick
I need to sum the field *COST* in this query where data in *STATUS* is equal to "HELD" and "OPEN", so I will have 2 totals passed below and do not know where to begin . All information is in 1 table. Original query select distinct(Company_name), account, City, State from table where number