Page 1 of 1

Multiple result/where query

Posted: Mon Apr 18, 2005 4:37 pm
by Burrito
I've got some fields on my database as follows:

field1 - num (can be between 1 and 24)
field2 - num (can be between 1 and 60)
field3 - num (can be infinite)

as you've probably already guessed, it is time related.

I need to take a tally of field 3 for every hour (field 1). I know I could accomplish this with 24 queries, but thought there might be a way to do it with one query and just consolidate it all into a single result set.

I can use subqueries (on 4.1), so if that helps, I'm ok.

please let me know if this can be done, and if so, how?

thx,

Burrito

Posted: Mon Apr 18, 2005 5:52 pm
by Burrito
I ended up just creating a for loop and looping over my query and result 24x...

it works, but I'm sure there's a better way.

Burrito

Posted: Mon Apr 18, 2005 8:26 pm
by feyd
don't quite know what you are trying to do there..