The first and the third queries are the same.
 
The second one changes the where clause from the form of:
'where a - b > 0' 
 
to:
'where a > b'
 
Shoudn't the two where clauses be the same? 
 
Why the second query shows nothing?
 
Thank you
 
====
 
sqlite> select planid, endtime, duration from plan where endtime + duration - 
strftime('%s', CURRENT_TIMESTAMP) > 0;
5|1334029971|486400
6|1335029971|586400
7|1336029971|686400
8|1337029971|786400
9|1338029971|886400
10|1339029971|986400
sqlite> select planid, endtime, duration from plan where endtime + duration > 
strftime('%s', CURRENT_TIMESTAMP);
sqlite>
sqlite> select planid, endtime, duration from plan where endtime + duration - 
strftime('%s', CURRENT_TIMESTAMP) > 0;
5|1334029971|486400
6|1335029971|586400
7|1336029971|686400
8|1337029971|786400
9|1338029971|886400
10|1339029971|986400
sqlite>
sqlite> .schema plan
CREATE TABLE plan
(
        PlanId integer PRIMARY KEY,
        TaskId integer DEFAULT 0,
        Cameraid varchar(64) DEFAULT '',
        MediaCompressType integer DEFAULT 0,
        MediaResolutionType integer DEFAULT 0,
        Url varchar(256) DEFAULT '',
        PlanType integer DEFAULT 0,
        starttime integer DEFAULT 0,
        endtime integer DEFAULT 0,
        Duration integer DEFAULT 0,
        AlarmSource varchar(256) DEFAULT '',
        AlarmType varchar(256) DEFAULT '',
        AlarmParm varchar(256) DEFAULT '',
        Response integer DEFAULT 0
);
sqlite> .exit

$
                                          
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to