I’m limping along trying to get some various SQL queries to work and have issues with trying to use IF or CASE in the SELECT statement. Eg:
SELECT B28H as State, Count (B28) as Min
, SUM ( IF B28H IN (1,2,3,5) THEN 1 ELSE 0 END) AS UpTime
, SUM ( IF B28H IN (1,2,3,5) THEN 1 ELSE 0 END) / Count (B28) AS PercentUpTime
WHERE t_stamp BETWEEN ‘2018-08-03 07:00:00’ AND ‘2018-08-07 19:00:00’
GROUP BY B28H
Is the SQL command set in Ignition limited? Does it support conditional logic in the SELECT statement? I scanned the documentation but didn’t see anything specifying what can/can’t do in Ignition.
Any pointers appreciated.