select trunc(time),count(distinct 流水号) from table_name group by trunc(time)
------解决方案--------------------
round(time)不是返回天数吧,而是
ROUND returns date rounded to the unit specified by the format model fmt. This function is not sensitive to the NLS_CALENDAR session parameter. It operates according to the rules of the Gregorian calendar. The value returned is always of data type DATE, even if you specify a different datetime data type for date. If you omit fmt, then date is rounded to the nearest day. The date expression must resolve to a DATE value.
引用自:http://docs.oracle.com/cd/E11882_01/server.112/e10592/functions154.htm#SQLRF51710 ------解决方案-------------------- select substr(t.time,1,10),count(distinct no) from table_name t group by substr(t.time,1,8);