I have the following DDL in SQLite:
CREATE TABLE money (
id INTEGER PRIMARY KEY,
'when' TIMESTAMP,
amount INTEGER,
note TEXT
) ;
I tried to view rows ordered by date:
sqlite3 -line money.db "select * from money order by datetime('when') desc limit 5"
But it does not return rows ordered by 'when' in reversed order. Also changing desc
to asc
gives exactly the same results. Tried also order by 'when'
instead of order by datetime('when')
. What should be the right query? Thanks!