How to quickly select DISTINCT dates from a Date/Time field, SQL Server

后端 未结 10 2098
别跟我提以往
别跟我提以往 2021-01-31 22:42

I am wondering if there is a good-performing query to select distinct dates (ignoring times) from a table with a datetime field in SQL Server.

My problem isn\'t getting

10条回答
  •  被撕碎了的回忆
    2021-01-31 23:14

    The simplest way is to add a computed column for just the date portion, and select on that. You could do this in a view if you don't want to change the table.

提交回复
热议问题