Hi,
I'm doing some analysis on a database of log messages and wondered if
anyone could help me pull out the data I need (I'm a MySQL newbie)
I have the following table called message which contains logged
events:
+--------------+------------------+------+-----+---------------------+-------+
| Field | Type | Null | Key | Default |
Extra |
+--------------+------------------+------+-----+---------------------+-------+
| id | int(10) unsigned | YES | MUL | NULL |
|
| depth | int(10) unsigned | YES | | NULL |
|
| thread_index | int(10) unsigned | YES | MUL | NULL |
|
| in_reply_to | int(10) unsigned | YES | | NULL |
|
| time | datetime | | | 0000-00-00 00:00:00 |
|
| user | varchar(255) | YES | | NULL |
|
| grp | varchar(255) | YES | | NULL |
|
| message | text | YES | | NULL |
|
| timeout | int(11) | YES | | NULL |
|
| replace_tag | varchar(255) | YES | | NULL |
|
| mime_type | varchar(255) | YES | | NULL |
|
| mime_args | text | YES | | NULL |
|
+--------------+------------------+------+-----+---------------------+-------+
What I want to do is SELECT * FROM message WHEN grp="x", which is
straightforward enough and selects about 900 events, but I also need
to select every event that occured in the 30 minutes after the 900
events where grp="x".
I can do this for each event individually using BETWEEN, but don't
know how to make it work over the whole list. Can anyone help?
Thanks,
Paul M