SELECT MAX(Change_Milli) AS Change_Milli, MAX(Change_DateTime) AS Change_DateTime FROM Table1 UNION ALL SELECT MAX(Change_Milli) AS Change_Milli, MAX(Change_DateTime) AS Change_DateTime FROM Table2 UNION ALL SELECT MAX(Change_Milli) AS Change_Milli, MAX(Change_DateTime) AS Change_DateTime FROM Table3
SELECT TOP 1 App_DateTime as R1,MAX(App_Milli) as R2 FROM ( Select App_DateTime, App_Milli FROM _Appli_Export_DEBIT_Export_Alarms UNION ALL Select App_DateTime, App_Milli FROM _Appli_Export_EVT_Export_Alarms UNION ALL Select App_DateTime, App_Milli FROM _Appli_Export_Motors_Export_Alarms UNION ALL Select App_DateTime, App_Milli FROM _Appli_Export_Valve_Export_Alarms UNION ALL Select App_DateTime, App_Milli FROM _Appli_histo_evt ) AS T1 WHERE T1.App_DateTime = ( Select MAX(App_DateTime) FROM ( Select MAX(App_DateTime) as App_DateTime FROM _Appli_Export_DEBIT_Export_Alarms UNION ALL Select MAX(App_DateTime) as App_DateTime FROM _Appli_Export_EVT_Export_Alarms UNION ALL Select MAX(App_DateTime) as App_DateTime FROM _Appli_Export_Motors_Export_Alarms UNION ALL Select MAX(App_DateTime) as App_DateTime FROM _Appli_Export_Valve_Export_Alarms UNION ALL Select MAX(App_DateTime) as App_DateTime FROM _Appli_histo_evt ) As T2 WHERE App_DateTime Is Not Null ) GROUP BY T1.App_DateTime ORDER BY T1.App_DateTime DESC
Select MAX(App_DateTime) as App_DateTime FROM _Appli_Export_DEBIT_Export_Alarms UNION ALL Select MAX(App_DateTime) as App_DateTime FROM _Appli_Export_EVT_Export_Alarms UNION ALL Select MAX(App_DateTime) as App_DateTime FROM _Appli_Export_Motors_Export_Alarms UNION ALL Select MAX(App_DateTime) as App_DateTime FROM _Appli_Export_Valve_Export_Alarms UNION ALL Select MAX(App_DateTime) as App_DateTime FROM _Appli_histo_evt
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question