[SQL] assistance on self join pls

2004-06-01 Thread email lists
Hi all, I have the following firewall connection data. datetime | protocol | port | inside_ip| outside_ip | outbound_count | outbound_bytes -+--+---++-- --++--- 2004-05-05 05:00:00 |

Re: [SQL] query not using index for descending records?

2004-01-30 Thread email lists
Hi, | You probably don't want to do that. The DESC only applies to the | one expression it follows. What you want is probably: | explain select datetime,id from trafficlogs order by | datetime desc,id desc limit 20; This is exactly what I was after - worked a treat! Thanks. Darren

Re: [SQL] date_trunc for 5 minutes intervals

2003-10-21 Thread email lists
Hi, Thanks for the several replies both on and off the list. To be more specific, I am wanting to aggregate data to a 5/10/15 min interval. Currently, I am aggregating data that falls in hour / day / month / year periods for both count() and sum(). The sql I am currently using is: SELECT