Group by hour in Oracle

problem

When put in a chart don't show all hours from day. I made a table from 1 to 24

solution

I found a simple method like this

  SELECT LEVEL - 1 AS time_hour
  FROM dual
  CONNECT BY LEVEL <= 24
Gravatar
Author: Dumitru Maros
Last Edit: July 3, 2024
1 Thanks received
Join in! I'm building here a library of useful solutions to software development problems. If you like this project, create an account or add a bookmark, then come back here to write a post yourself when you run into something that might be useful to others... >> read more

Your Comment

Feel free to post additional info or improvement suggestions.
preview
Optional, never shown, displays gravatar.

Formatting Tips

This editor uses Markdown to easily add code in your posts.

Triple backticks for full line(s) of code (or indent 4 spaces)

```
let foo = 'bar';
```

[link text](http://a.com)

*italic* **bold**

More Tips