RE: Avanced query question

2002-02-12 Thread John Lodge
: Avanced query question Hello, 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

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

Avanced query question

2002-02-12 Thread Almar van Pel
Hello, 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 returns the hour and the

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

Avanced query question

2002-02-09 Thread Almar van Pel
Hello, 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 returns the hour and the