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

Question on SELECT

2006-12-27 Thread Ashley M. Kirchner
Hi All, I have a table that's described as follows: ++---+--+-+---++ | Field | Type | Null | Key | Default | Extra | ++---+--+-+-

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;

Question on SELECT support

2003-10-17 Thread Dale Hans
Hi, I am trying to select the first 10 rows of a table by the date the record was created. I have a date field in the table and I tried using the TOP syntax of SELECT, but I keep getting syntax error. SELECT TOP 10 DateCreatedField FROM my_table ORDER BY DateCreatedField DESCENDING Does MySQL no

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

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

2003-02-11 Thread Anya
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 of each fruit appears in the favorite_fruits of the kids in the table. Is there anyway to

Question on select

2001-06-25 Thread Leonardo Rodrigues Magalhães
Hello Guys, I have a char field, and I'd like to have select ordering it by lowercase caracteres, uppercase caracters then special characters. I was reading about sort and this seems to be related to charset of the server, and I dont have access to change this. I was thinking on

RE: question on select

2001-01-23 Thread Cal Evans
Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Cindy Sent: Tuesday, January 23, 2001 6:32 PM To: [EMAIL PROTECTED] Subject: question on select OK, let's say I have two tables. The first is a table full of people -- their names, address, phone numbers. The s

RE: question on select

2001-01-23 Thread Quentin Bennett
PROTECTED]] Sent: Wednesday, 24 January 2001 13:32 To: [EMAIL PROTECTED] Subject: question on select OK, let's say I have two tables. The first is a table full of people -- their names, address, phone numbers. The second table is an inventory, which among other things, has a pointer to the first

question on select

2001-01-23 Thread Cindy
OK, let's say I have two tables. The first is a table full of people -- their names, address, phone numbers. The second table is an inventory, which among other things, has a pointer to the first table for who currently has possession of the item. so I select from the two tables to print out a