Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 SQL Process Map Query

Author  Topic 

tlug
Starting Member

21 Posts

Posted - 2015-01-22 : 10:20:51
Hello,

I have a data set that I have created but I need to get a true or false by Event ID if the Triggers were done in order based on the steps listed in the Step column.. The data below shows the steps were done out of order so I want to query the EventID and a value telling me it wasn't done in order.

Thank you in advance for your help!



Thanks!

tlug
Starting Member

21 Posts

Posted - 2015-01-22 : 10:21:48
Not sure why the pic didn't show up but picture of the data should be able to be viewed at the link..

[url]https://docs.google.com/file/d/0B5TX97oiRQrHX3c1aG1hUFAxWFE/edit?usp=docslist_api[/url]

Thanks!
Go to Top of Page

viggneshwar
Yak Posting Veteran

86 Posts

Posted - 2015-01-23 : 05:37:26
select distinct eventid, case when b.eventid is null then false else true end
from eventtable a
left outer join ordertable b
on a.eventid = b.eventid

Regards
Viggneshwar A
Go to Top of Page

waterduck
Aged Yak Warrior

982 Posts

Posted - 2015-01-26 : 04:00:10
select *, ROW_NUMBER() over (partition by eventid order by dates, logtime)
from [table]
Go to Top of Page
   

- Advertisement -