![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| ||||
| ||||
|
|
I'd like to represent an interval like '1 day 1h 2m 12s' in days, in this case 25 |
|
Apparently SELECT to_char(interval '1 day 1h 2m 12s', ' HH24'); returns only one hour. I read that HH24 can return more than 24 hours, which it does with e.g.: SELECT to_char(interval '25h 2m 12s', ' HH24'); |
|
Is there a more convenient way of returning the number of hours than with a contruct like the following? SELECT EXTRACT( DAY FROM interval '1 day 25h 2m 12s')*24 + EXTRACT( HOUR FROM interval '1 day 25h 2m 12s'); |
|
And what if the interval is longer than a month? How many day's has an "interval-month"? |
#3
| ||||
| ||||
|
|
I'd like to represent an interval like '1 day 1h 2m 12s' in days, in this case 25 |
|
Apparently SELECT to_char(interval '1 day 1h 2m 12s', ' HH24'); returns only one hour. I read that HH24 can return more than 24 hours, which it does with e.g.: SELECT to_char(interval '25h 2m 12s', ' HH24'); |
|
Is there a more convenient way of returning the number of hours than with a contruct like the following? SELECT EXTRACT( DAY FROM interval '1 day 25h 2m 12s')*24 + EXTRACT( HOUR FROM interval '1 day 25h 2m 12s'); |
|
And what if the interval is longer than a month? How many day's has an "interval-month"? |
#4
| ||||
| ||||
|
|
I'd like to represent an interval like '1 day 1h 2m 12s' in days, in this case 25 |
|
Apparently SELECT to_char(interval '1 day 1h 2m 12s', ' HH24'); returns only one hour. I read that HH24 can return more than 24 hours, which it does with e.g.: SELECT to_char(interval '25h 2m 12s', ' HH24'); |
|
Is there a more convenient way of returning the number of hours than with a contruct like the following? SELECT EXTRACT( DAY FROM interval '1 day 25h 2m 12s')*24 + EXTRACT( HOUR FROM interval '1 day 25h 2m 12s'); |
|
And what if the interval is longer than a month? How many day's has an "interval-month"? |
#5
| ||||
| ||||
|
|
I'd like to represent an interval like '1 day 1h 2m 12s' in days, in this case 25 |
|
Apparently SELECT to_char(interval '1 day 1h 2m 12s', ' HH24'); returns only one hour. I read that HH24 can return more than 24 hours, which it does with e.g.: SELECT to_char(interval '25h 2m 12s', ' HH24'); |
|
Is there a more convenient way of returning the number of hours than with a contruct like the following? SELECT EXTRACT( DAY FROM interval '1 day 25h 2m 12s')*24 + EXTRACT( HOUR FROM interval '1 day 25h 2m 12s'); |
|
And what if the interval is longer than a month? How many day's has an "interval-month"? |
#6
| ||||
| ||||
|
|
I'd like to represent an interval like '1 day 1h 2m 12s' in days, in this case 25 |
|
Apparently SELECT to_char(interval '1 day 1h 2m 12s', ' HH24'); returns only one hour. I read that HH24 can return more than 24 hours, which it does with e.g.: SELECT to_char(interval '25h 2m 12s', ' HH24'); |
|
Is there a more convenient way of returning the number of hours than with a contruct like the following? SELECT EXTRACT( DAY FROM interval '1 day 25h 2m 12s')*24 + EXTRACT( HOUR FROM interval '1 day 25h 2m 12s'); |
|
And what if the interval is longer than a month? How many day's has an "interval-month"? |
#7
| ||||
| ||||
|
|
I'd like to represent an interval like '1 day 1h 2m 12s' in days, in this case 25 |
|
Apparently SELECT to_char(interval '1 day 1h 2m 12s', ' HH24'); returns only one hour. I read that HH24 can return more than 24 hours, which it does with e.g.: SELECT to_char(interval '25h 2m 12s', ' HH24'); |
|
Is there a more convenient way of returning the number of hours than with a contruct like the following? SELECT EXTRACT( DAY FROM interval '1 day 25h 2m 12s')*24 + EXTRACT( HOUR FROM interval '1 day 25h 2m 12s'); |
|
And what if the interval is longer than a month? How many day's has an "interval-month"? |
#8
| ||||
| ||||
|
|
I'd like to represent an interval like '1 day 1h 2m 12s' in days, in this case 25 |
|
Apparently SELECT to_char(interval '1 day 1h 2m 12s', ' HH24'); returns only one hour. I read that HH24 can return more than 24 hours, which it does with e.g.: SELECT to_char(interval '25h 2m 12s', ' HH24'); |
|
Is there a more convenient way of returning the number of hours than with a contruct like the following? SELECT EXTRACT( DAY FROM interval '1 day 25h 2m 12s')*24 + EXTRACT( HOUR FROM interval '1 day 25h 2m 12s'); |
|
And what if the interval is longer than a month? How many day's has an "interval-month"? |
#9
| ||||
| ||||
|
|
I'd like to represent an interval like '1 day 1h 2m 12s' in days, in this case 25 |
|
Apparently SELECT to_char(interval '1 day 1h 2m 12s', ' HH24'); returns only one hour. I read that HH24 can return more than 24 hours, which it does with e.g.: SELECT to_char(interval '25h 2m 12s', ' HH24'); |
|
Is there a more convenient way of returning the number of hours than with a contruct like the following? SELECT EXTRACT( DAY FROM interval '1 day 25h 2m 12s')*24 + EXTRACT( HOUR FROM interval '1 day 25h 2m 12s'); |
|
And what if the interval is longer than a month? How many day's has an "interval-month"? |
#10
| |||
| |||
|
|
And what if the interval is longer than a month? How many day's has an "interval-month"? 30. Without knowing which month it is, you cannot tell its accurate length. That is an inherent problem of an interval data type. |
![]() |
| Thread Tools | |
| Display Modes | |
| |