RE: Avanced query question

2002-02-12 Thread John Lodge
Parse the hours column in the result set. Keep track of last hour number processed. If a number is missing, then its count can be assumed to be zero. John Lodge -Original Message- From: Almar van Pel [mailto:[EMAIL PROTECTED]] Sent: Saturday, February 09, 2002 10:55 AM To: Mysql Subject:

RE: Avanced query question

2002-02-12 Thread Roger Baklund
* DL Neil > Consider: > a) add a 'construction' table with the row-values 0 through 11 > (or 23) and use it to do a left join against the > messages tbl; > b) if the database is not busy, use perl to fire off 12 (or 24) > separate queries. c) use perl to 'fill in the holes', putting zero values i

Re: Avanced query question

2002-02-12 Thread DL Neil
Hello Almar > I have a question about a query. We have a guestbook and I want to do some > statistics for the messages in it. So I've created a query that looks like > this. > > select hour(msg_date_time), count(*) > from messages > where user_id = 'almar' > group by hour(msg_date_time) > > It re

RE: Avanced query question

2002-02-09 Thread Roger Baklund
* DL Neil > Consider: > a) add a 'construction' table with the row-values 0 through 11 > (or 23) and use it to do a left join against the > messages tbl; > b) if the database is not busy, use perl to fire off 12 (or 24) > separate queries. c) use perl to 'fill in the holes', putting zero values i

Re: Avanced query question

2002-02-09 Thread DL Neil
Hello Almar > I have a question about a query. We have a guestbook and I want to do some > statistics for the messages in it. So I've created a query that looks like > this. > > select hour(msg_date_time), count(*) > from messages > where user_id = 'almar' > group by hour(msg_date_time) > > It re