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

SWQL Case statement used in EOC

Jump to solution

Has anyone successfully used case in SWQL in the EOC that is willing to share code snippet? My team has been struggling with this and I think this is the answer to one of my reporting problems.

Thank you

0 Kudos
1 Solution
Product Manager
Product Manager

tmcurry​ it is possible to use case keyword in SWQL from EOC Instance - here is a basic example:

SELECT TOP 1000

CASE

WHEN n.IP like '10.%' then 'Local 10.'

WHEN n.IP like '192.%' then 'Local 192.'

WHEN n.IP like '172.%' then 'Local 172.'

ELSE 'Global'

END AS IpAddressType

FROM Orion.Nodes n

Hopefully that helps.

View solution in original post

2 Replies
Product Manager
Product Manager

tmcurry​ it is possible to use case keyword in SWQL from EOC Instance - here is a basic example:

SELECT TOP 1000

CASE

WHEN n.IP like '10.%' then 'Local 10.'

WHEN n.IP like '192.%' then 'Local 192.'

WHEN n.IP like '172.%' then 'Local 172.'

ELSE 'Global'

END AS IpAddressType

FROM Orion.Nodes n

Hopefully that helps.

View solution in original post

Level 9

Thank you for your response I used this baseline. Sorry for the late kudos operator head space error with applying the correct answer.

0 Kudos