Write a querry to count on hourly bases of how many books are sold in a given day

Showing Answers 1 - 2 of 2 Answers

Dhaval

  • Nov 14th, 2006
 

Select Count(*) , DATEPART ( hh , sellbooksdate) From bookssellWhere sellbooksdate = '14 Nov 2006'Group By DATEPART ( hh , sellbooksdate)

  Was this answer useful?  Yes

bhargav

  • Nov 27th, 2006
 

        To calculate number of hours ...

          1) we have to find out difference between date, base on number of hours.

        2) we have to total number of hours.

        Select To_char(to_date('00:00:00','hh24:mi:ss')+(date_column1-date_colum2),'hh24:MI:SS') FROM <TABLE NAME>

         SELECT COUNT(*) FROM <TABLE NAME>

         ( Which contains datediff column containing number of hours )

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions