Why is this
SELECT strftime('%s', timestamp,'localtime') from locationLog WHERE strftime('%s', timestamp,'localtime') > 999999999999999999 ORDER BY _id DESC
return any outputs when all of my rows have a lower value in “timestamp”
in my case the query above returns
1334735588
1334735349
1334734317
1334734178
1334734172
and so on...
it returns my whole table.
if I switch > to < it returns nothing.
I guess I’m trying to compare different type of variables or something like that.
You are comparing a
textvalue with aintegervalue, so sqlite casts theintegervalue totext, and does a string comparison:As shown above, the solution is to cast the returned value of
strftimeto some numeric type.