AnsweredAssumed Answered

SQL query last messurement

Question asked by Servicemonitoring on Mar 30, 2016
Latest reply on Mar 31, 2016 by Servicemonitoring

Hello everyone.

 

I´m looking for an SQL Statement to get the latest messurement of a Profile with ist messure value.

To get just the latest messure date is really easy.

 

SELECT d.robot, d.target, max(rn.sampletime) as "Last Messuretime" FROM RN_QOS_DATA_0012 as rn,S_QOS_DATA as d   WHERE d.table_id = rn.table_id     AND target not LIKE 'QS_%'   AND target not LIKE 'TEST_%'   AND target not LIKE 'ENTW_%'    AND  target not LIKE '%Ctrl%'  AND target not LIKE '%Arbeitsplatzaufbau%'    AND target not LIKE 'RT_%'  --and rn.samplevalue is not NULL  AND target LIKE '%gesamt%'  group by d.robot, d.target order by max(rn.sampletime)

 

But how to get also the matching samplevalue?

I would be really happy to get some help!

 

Kind regards

Outcomes