Top.Mail.Ru
samwize, posts by tag: sql - LiveJournal — LiveJournal
? ?

samwize, posts by tag: sql - LiveJournal

Out of the depths...

Journal Info

Bad Baby
Name
Sam

View

July 30th, 2007

A little help?

Share Flag
Head Smashy
Ok, my brain is broken today and I can't seem to think in SQL right. Totally blanking here.

Here's the situation. We have an event log table called [EVENTS]. It's got a bunch of columns, but all we care about are UNIQUEID, DTTMSTAMP, and MESSAGE.

There's two kinds of events I'm interested in: the ones saying "Task started" and the ones says "Task Failed". What I need is all of the "Task Failed" types with the "Task started" message that is most recent before it.

There's lots more started than fail (obviously).

How do I do that join?
Tags:
Powered by LiveJournal.com
Image