Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2002
    Posts
    123

    Unanswered: GROUP BY on time of a date

    Hi,

    Dos anyone know how I can do a group by on a timestamp column based on the time?

    I have records like this--

    id, '2008-02-01-00.00.00.000000', val
    id, '2008-02-01-01.00.00.000000', val
    id, '2008-02-01-02.00.00.000000', val
    id, '2008-02-01-03.00.00.000000', val
    id, '2008-03-01-00.00.00.000000', val
    id, '2008-03-01-01.00.00.000000', val
    id, '2008-03-01-02.00.00.000000', val
    id, '2008-03-01-03.00.00.000000', val


    I want the SUM of val for '2008-02-01-00.00.00.000000' and '2008-03-01-00.00.00.000000'

    and then the SUM of val for '2008-02-01-01.00.00.000000' and '2008-03-01-01.00.00.000000'


    and so on... thanks !!

  2. #2
    Join Date
    Jun 2003
    Location
    Toronto, Canada
    Posts
    5,516
    Provided Answers: 1
    Use the HOUR() function
    ---
    "It does not work" is not a valid problem statement.

  3. #3
    Join Date
    Dec 2002
    Posts
    123
    thanks..it worked!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •