0

I am a beginner in programming and especially SQL. I am working with the SQLDeveloper on the AOLDATA-database. The structure of the table I am working on looks like this: AOLDATA.querydata

I did not figured out how to write a statement that provides the timestamps splitted into different parts. I want to know how often was searched for a term, for the whole interval(01.03.2006-28.05.2006). My approach to solve the problem is:

SELECT COUNT (id)
FROM AOLDATA.querydata
WHERE querytime between ('01.03.2006 00:00:00') 
AND ('01.03.2006 00:59:00')
AND QUERY LIKE '%burgerking%';

But when I do it this way, I have to start more than 2000 requests to cover the whole timeframe.As a result the best output would be to have in a format like this.

Term: burgerking

  • Monday(00:00-00:59 (40 results),…,23:00-23:59(13 results))
  • …</li>
  • …</li>
  • …</li>
  • …</li>
  • …</li>
  • Sunday(00:00-00:59 (40 results),…,23:00-23:59(13 results))

Is there any good solution like a loop or something else easy way to do it?

4

1 に答える 1