cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Level 9

Query returns a NULL

Simple Query getting 1 rool not returming 1 row or return a null

This works or at least passes the test?

use SolarWindsOrion

Select

Case

       when traps.Message like '%oraEMNGEventTypeAttr1.1=Availability status=Up%' then 1

       when traps.Message like '%oraEMNGEventTypeAttr1.1=Availability status=Down%' then 2 

end as status

from traps

where Timestamp=

       (Select Max(TimeStamp)

       from traps

       where traps.IPAddress='XXX.XXX.XXX.XX'

       )

This returns Query results is NULL

use SolarWindsOrion

Select

Case

       when traps.Message like '%aixRT.1.1.1 = Test snmptrap = Up%' then 1

       when traps.Message like '%aixRT.1.1.1 = Test snmptrap = Down%' then 2 

end as status

from traps

where Timestamp=

       (Select Max(TimeStamp)

       from traps

       where traps.IPAddress='XXX.XXX.XXX.XX'

       )

Basically the same.

Tags (1)
0 Kudos