SQL Server Server query - Count distinct DateTime field

后端 未结 5 1656
甜味超标
甜味超标 2020-12-30 08:43

Supposing we have the following records in an SQL Server table.

Date
19/5/2009 12:00:00 pm
19/5/2009 12:15:22 pm
20/5/2009 11:38:00 am

What

5条回答
  •  一个人的身影
    2020-12-30 09:25

    Depends on your DBMS. Example for Mysql:

    SELECT DATE_FORMAT(dateColumn, '%e/%c/%Y') as `date`, COUNT(*)
    FROM YourTable
    GROUP BY `date`
    

提交回复
热议问题