tridat
tridat

Reputation: 81

Mysql selecting and sorting by the bigger field

I have two fields on my table, lets say date_created and date_updated

I want to select 20 recently updated/created records

so it means i have to choose the top dates from both fields, how do i do that?

Upvotes: 2

Views: 37

Answers (1)

tridat
tridat

Reputation: 81

found it!

greatest(field1,field2)

Upvotes: 1

Related Questions