SQL SELECT statements...? week/day/24h
Posted: Tue Jul 01, 2008 9:05 pm
Can someone help with some examples for properly results for a graphic from electricity?
This the one for the last 60 minutes.
Could it be easier?
SELECT twatt, MINUTE(ttime) FROM elec ttime > SUBTIME(curtime(), '01:00:00') AND tdate = CURDATE() ORDER by tdate DESC, ttime ASC LIMIT 60"
After midnight, it will not show the previous day results...
I can'y see the logic with SQL... and want a easy table in SQL
for the moment, i have; date, time, devicecode, valueofcounter, watt
And i'm using chartdirector...
thanks!
This the one for the last 60 minutes.
Could it be easier?
SELECT twatt, MINUTE(ttime) FROM elec ttime > SUBTIME(curtime(), '01:00:00') AND tdate = CURDATE() ORDER by tdate DESC, ttime ASC LIMIT 60"
After midnight, it will not show the previous day results...
I can'y see the logic with SQL... and want a easy table in SQL
for the moment, i have; date, time, devicecode, valueofcounter, watt
And i'm using chartdirector...
thanks!