title: How to get the hour and minutes in oracle sql?
body: <p>I want to get and display the date, hours and minutes separately (3 columns: date, hours and minutes)</p>
  
  <p>My script doesn't work. How to fix this? Thank you</p>
  
  <p>Here's the sql:</p>
  
  <pre><code> select trunc(t.create_time, 'DD') as createdate
              ,trunc(t.close_time, 'DD') as closedate
              ,datepart(hour, t.close_time()) as hours
              ,datepart(minute, t.close_time()) as minutes
              ,count(t.close_time) as total
        from app_account.otrs_ticket t
        left join app_account.otrs_user u
        on t.create_user_id=u.id
        where u.id not in (15,7,31,49,50,52,62,66,69,106,17,24,44,32,33,55,22,29,30,47,45,53,70,74,109,1,2,10,23,68,80,20,21,56,108,67)
        group by trunc(t.create_time, 'DD')
                ,trunc(t.close_time, 'DD')
                ,datepart(hour, t.close_time())
                ,datepart(minute, t.close_time())
        order by trunc(t.create_time, 'DD') desc
  </code></pre>