This really isn't SQL Server specific but I thought this group might be of help. I am working on an application that currently logs events from a control system in a plant. I would like to determine cause-effect relationships between events.

i.e. - When Event A happens, event B happens 79% of the time within 1 minute of event A. Event C also happens 54% of the time within 1 minute. If I expand the window to two minutes.... etc.

You get the idea. Only problem is that my grasp of SQL is pretty shallow and I get pretty lost when you start doing anything beyond computing sums, counts, or selecting a set of rows.

Could someone either give me a nudge, point me to a good resource, or if you're really nice flesh out the SQL to help me accomplish this task?

Thanks in advance,
Andy Robinson