Re: Combining several sum queries

2005-06-22 Thread leegold
On Wed, 22 Jun 2005 09:55:39 -0400, [EMAIL PROTECTED] said: > Jochem van Dieten <[EMAIL PROTECTED]> wrote on 06/22/2005 07:34:30 AM: > > > On 6/22/05, David Kagiri wrote: > > > When i run the queries below they all work just fine > > > > > > SELECT sum(consultation)+ sum(laboratory) FROM nairobi,

Re: Combining several sum queries

2005-06-22 Thread SGreen
`laboratory` to the query. Second, because of the Cartesian product used to compute the JOINed dataset, you wind up with duplicates of the rows from both `coast` and `riftvalley`. The final SUM() could be off by some multiple based on the numbers of rows in each table. This is a tricky problem to

Re: Combining several sum queries

2005-06-22 Thread Jochem van Dieten
On 6/22/05, David Kagiri wrote: > When i run the queries below they all work just fine > > SELECT sum(consultation)+ sum(laboratory) FROM nairobi,familymembers WHERE > familymembers.dependantid = nairobi.memberid and familymembers.memberid = > "AKI1" > > SELECT sum(consultation)+ sum(labora

Combining several sum queries

2005-06-21 Thread David Kagiri
When i run the queries below they all work just fine SELECT sum(consultation)+ sum(laboratory) FROM nairobi,familymembers WHERE familymembers.dependantid = nairobi.memberid and familymembers.memberid = "AKI1" SELECT sum(consultation)+ sum(laboratory) FROM riftvalley,familymembers WHERE f

Re: sum queries

2004-12-03 Thread Roger Baklund
James Nunnerley wrote: * Roger Baklund: select date_format(ts,"%Y-%m-%d %H") period,sum(rcvd),sum(sent) from mytable group by period; So the below query above will allow me to group by hour - which is quite useful - is there anyway of grouping by say 3 hour periods? Not using the date_format()

RE: sum queries

2004-12-03 Thread James Nunnerley
> -Original Message- > From: James Nunnerley [mailto:[EMAIL PROTECTED] > Sent: 03 December 2004 16:13 > To: 'Roger Baklund'; '[EMAIL PROTECTED]' > Subject: RE: sum queries > > > -Original Message- > > From: Roger Baklund [mailto:

RE: sum queries

2004-12-03 Thread James Nunnerley
> -Original Message- > From: Roger Baklund [mailto:[EMAIL PROTECTED] > Sent: 03 December 2004 16:03 > To: [EMAIL PROTECTED] > Cc: James Nunnerley > Subject: Re: sum queries > > James Nunnerley wrote: > > I'm trying to create a table, and ultimately a

Re: sum queries

2004-12-03 Thread Roger Baklund
James Nunnerley wrote: I'm trying to create a table, and ultimately a graph, out of some syslog data. I have a table with the following info in it: Time (unixtime stamp), bytes rcvd and bytes sent I want to create a sql statement that group the data over a certain period of time, and produces

sum queries

2004-12-03 Thread James Nunnerley
I'm trying to create a table, and ultimately a graph, out of some syslog data. I have a table with the following info in it: Time (unixtime stamp), bytes rcvd and bytes sent I want to create a sql statement that group the data over a certain period of time, and produces the following table

Re: Multiple Sum Queries

2002-04-27 Thread Paul DuBois
At 14:24 -0500 4/27/02, [EMAIL PROTECTED] wrote: >I have a table full of cell phone data with three important columns: >ServiceNumber, ratingPeriod (1,2 or 3) and minutes. I want to run a >query grouped by serviceNumber that gives me the sum of minutes per >rating period for each of the numbers

Multiple Sum Queries

2002-04-27 Thread dstark
I have a table full of cell phone data with three important columns: ServiceNumber, ratingPeriod (1,2 or 3) and minutes. I want to run a query grouped by serviceNumber that gives me the sum of minutes per rating period for each of the numbers in the other cloumns. So the query result will loo