Sandah Aung
Sandah Aung

Reputation: 6188

Latest date from date, month, year

I have an SQLite DB with date, month, year fields in integers (I believe they should have used a date field but the choice wasn't mine). I would like to select the row whose date value is the latest. What is the best query to do that?

Upvotes: 0

Views: 38

Answers (1)

juergen d
juergen d

Reputation: 204894

select * from your_table
order by year, month, `date` desc
limit 1

Upvotes: 1

Related Questions