user2693049
user2693049

Reputation: 15

sqlite greater than comparison(>) doesn't seem to work for custom types

Does SQLite support greater than(>) comparison between two custom objects? For example, if I run this query:

select myDate from test where myDate > '2010'

against my SQLite database, which contains several records either earlier or later than year 2010, I expect to get a return that only contains those whose date is later than year 2010. By the way, I store dates as a registered custom type in myDate Column. However, in reality, it returned every records, basically ignored my WHERE clause completely. Is such comparison supported at all? Many thanks.

Upvotes: 1

Views: 3058

Answers (1)

juergen d
juergen d

Reputation: 204766

select myDate from test 
where substr(myDate, 1, 4) > '2010'

SQLFiddle demo

Upvotes: 2

Related Questions