SQL 59
Création des vues températures par heure et par jour By jledun on 12th March 2025 02:37:10 PM
  1. CREATE VIEW ventilation_cellules_H AS
  2. SELECT * FROM ventilation_cellules T1,
  3. (SELECT Time_Stamp AS tmpTime
  4. FROM ventilation_cellules
  5. GROUP BY DATE(Time_Stamp), HOUR(Time_Stamp)) T2
  6. WHERE T1.Time_Stamp = T2.tmpTime;
  7.  
  8. CREATE VIEW ventilation_cellules_j AS
  9. SELECT * FROM ventilation_cellules T1,
  10. (SELECT MIN(Time_Stamp) AS tmpTime
  11. FROM ventilation_cellules
  12. GROUP BY DATE(Time_Stamp)) T2
  13. WHERE T1.Time_Stamp = T2.tmpTime;

Paste is for source code and general debugging text.

Login or Register to edit, delete and keep track of your pastes and more.

Raw Paste

Login or Register to edit or fork this paste. It's free.