开发者

Mysql selecting and sorting by the bigger field

开发者 https://www.devze.com 2022-12-27 21:07 出处:网络
I have two fields on my table, lets say date_created and date_updated Iwant to select 20 recently updated/created records

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?


found it!

greatest(field1,field2)

0

精彩评论

暂无评论...
验证码 换一张
取 消