Re: [MySQL] Re: Question on SELECT

2006-12-27 Thread Chris Comparini
On Wednesday 27 December 2006 17:12, Ashley M. Kirchner wrote: > Chris Comparini wrote: > > Try something like this: > > > > select hour(time) as the_hour, avg(temp_f) as average_temp_f > > from data > > where time > now() - interval 24 hour > > group by the_hour; > > Thanks Chris. Questi

Re: [MySQL] Re: Question on SELECT

2006-12-27 Thread Ashley M. Kirchner
Chris Comparini wrote: Try something like this: select hour(time) as the_hour, avg(temp_f) as average_temp_f from data where time > now() - interval 24 hour group by the_hour; Thanks Chris. Question though, why is it that when I change that to 48 hours, it only gives me 24 results (s

Re: Question on SELECT

2006-12-27 Thread Chris Comparini
On Wednesday 27 December 2006 16:24, Ashley M. Kirchner wrote: >[...] > > I want to display a graph for the last 24 hours by averaging each > hour. Since I get (at most) 60 readings per hour, I need to average > them out to get a number for that hour. Do I have to do this averaging > outside

Re: Question on SELECT support

2003-10-17 Thread Tobias Asplund
MySQL doesn't support TOP, however, there's a LIMIT syntax for MySQL that roughly does the same thing: http://www.mysql.com/doc/en/SELECT.html for a brief explanation. In your example what you are looking for is: SELECT DateCreatedField FROM my_table ORDER BY DateCreatedField DESC LIMIT 10;

Re: question on "select group by a 'set' field"

2003-02-11 Thread Anya
Thanks, Fred. It works perfectly. At 01:00 PM 2/11/2003 +0100, Fred van Engen wrote: >Hello Anya, > >On Tue, Feb 11, 2003 at 07:51:00PM +0800, Anya wrote: >> >> >> Dear all, >> I have a table Kids which has the following fields: >> >> kid char(20), >> favorite_fruits set('apple','pear','orange

Re: question on "select group by a 'set' field"

2003-02-11 Thread Fred van Engen
Hello Anya, On Tue, Feb 11, 2003 at 07:51:00PM +0800, Anya wrote: > > > Dear all, > I have a table Kids which has the following fields: > > kid char(20), > favorite_fruits set('apple','pear','orange',) > > favorite_fruits has choices of up to 64 items. > > Now I want to query the count o

RE: question on select

2001-01-23 Thread Cal Evans
Off the top of my head: (so it may not work) SELECT Inventory.*, P1.name, P2.name FROM Inventory, People P1, People P2 WHERE Inventory.in_possession = P1.person_id and inventory.returned_to = P2.person_id Cal http://www.calevans.com -Original M

RE: question on select

2001-01-23 Thread Quentin Bennett
Hi, Does using an alias achieve what you want? SELECT Inventory.*, p1.name, p2.name FROM Inventory, People as p1, People as p2 where Inventory.in_possession = p1.person_id and Inventory.returned_to = p2.person_id; Regards Quentin -Original Message- From: Cindy [mailto:[EMAIL PROTECTE