Saobi
Saobi

Reputation: 17041

Oracle Query Help

I have this table

  ID          Date
  1   08/10/2009 11:20:00
  2   08/10/2009 12:06:06
  3   08/11/2009 13:03:10
  4   08/11/2009 01:20:00
  5   08/11/2009 15:41:23
  6   08/12/2009 14:22:20

I want to return:

Date          Count
08/10/2009     2
08/11/2009     3
08/12/2009     1

in PL/SQL. Any ideas?

Upvotes: 1

Views: 90

Answers (1)

Quassnoi
Quassnoi

Reputation: 425753

SELECT  TRUNC(date) AS CreatedDate, COUNT(*) AS DateCount
FROM    mytable
GROUP BY
        TRUNC(date)
ORDER BY
        CreatedDate

Upvotes: 10

Related Questions