select * from su.el order by timestamp desc; select timestamp,skovelc,levelc from su.el where timestamp>'2010-10-25' order by timestamp desc; select timestamp, skovelmean,levelmean,levelprognosis,cmd,skovelhi,skovello from su.history where timestamp>'2010-11-25' order by timestamp desc; select * from ips.ip order by timestamp desc; SELECT `nordpoolse`.`time`, `nordpoolse`.`eur`, `nordpoolse`.`sek`, `nordpoolse`.`timestamp` FROM `su`.`nordpoolse` order by time desc; SELECT `a`.`id`, `a`.`timestamp` as at, `b`.`timestamp` as bt, `b`.`timestamp`, `a`.`skovelnow` as Ao, `b`.`skovelnow` As Bo, `a`.`levelmean` as Al, `b`.`levelmean` as Bl, `a`.`levelnow`-`b`.`levelnow` as delta, `b`.`levelmean` as Bm, `a`.`levelprognosis`as Ap, `b`.`levelprognosis`as Bp, `a`.`running`, `a`.`cmd` FROM `su`.`history` a, `su`.`history` b where (b.id=a.id-2) and (b.running=0) and (a.running=1) and (a.skovelnow>100) order by a.timestamp desc; SELECT nordpoolse.time, nordpoolse.eur FROM su.`nordpoolse` where time>'2010-11-11' order by time desc; SELECT nordpoolse.time, nordpoolse.eur FROM su.nordpoolse where (time>'2010-11-13 14:34:49') and (time<'2010-11-14 14:34:49') order by time asc; select timestamp, templagerc from su.el where templagerc>-200 order by timestamp desc; select a.timestamp, a.levelmean as ale, a.skovelmean as ask,b.levelmean as ble,b.skovelmean as bsk, a.levelmean-b.levelmean as delta from su.history a, su.history b where (b.id=a.id+1) and (abs(a.skovelmean-b.skovelmean)>0.0002) order by a.timestamp desc; select timestamp,levelc,levelprognosis,levelestimate,skovelc from su.el where timestamp>'2010-11-25' order by timestamp desc; select * from su.el where timestamp>'2010-11-25' order by timestamp desc; select (a.timestamp),a.skovelc from su.el a, su.el b where (a.timestamp>'2010-12-07') and (a.id=b.id+1) and (abs(a.skovelc-b.skovelc)>1)order by a.timestamp desc; select max(a.timestamp) from su.el a where (a.timestamp>'2010-12-07'); select (a.timestamp),a.skovelc from su.el a, su.el b where (a.id>599231-100) and (b.id>599231-100) and (a.id=b.id+1) and (abs(a.skovelc-b.skovelc)>1)order by a.timestamp desc; select max(id) from su.el into @idmax; select max(a.id) from su.el a, su.el b where (a.id>@idmax-20) and (b.id>@idmax-21) and (a.id=b.id+1) and (abs(a.skovelc-b.skovelc)>1) into @id1; SELECT CASE WHEN @id1>0 THEN @id1 ELSE @idmax-20 END into @id2; select @id1; select @idmax;