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
Last Edit July 3, 2024
Created July 2, 2024
Views 45
Tags
Oracle
SQL

Join us!

Do you like this website?

Bookmark it and come back here to write a post yourself when you run into something shareable.

Early collaborators will get to own a part of the project (5 to 20%)... >> 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