MySQL group by date and convert from unix timestamp

前端 未结 1 1399
借酒劲吻你
借酒劲吻你 2021-01-01 05:35

I have the following sql table (simplified)

ID (int)  title (text)            date (int)
--------------------------------------------
1         Hello World           


        
1条回答
  •  执笔经年
    2021-01-01 06:05

    You can use from-unixtime()

    select FROM_UNIXTIME(`date`, '%d.%m.%Y') as ndate,
           count(id) as post_count
    from your_table
    group by ndate
    

    0 讨论(0)
提交回复
热议问题