根据子时间戳排除时间戳(postgresql)
exclude timestamps depending of a sub-timestamp (postgresql)
我有这样的数据:
ID | timespan
------ | ------
1 | 12 days 23:45:00
2 | 02:45:00
3 | 23:45:00
4 | 10 days 03:30:00
我想排除包含 23:45:00 的每个时间跨度
所以我得到了这个输出
ID | timespan
------ | ------
2 | 02:45:00
4 | 10 days 03:30:00
where子句应该怎么写?
with data(id, timespan) as (
values
( 1, '12 days 23:45:00'::interval),
( 2, '02:45:00'),
( 3, '23:45:00'),
( 4, '10 days 03:30:00')
)
select *
from data
where timespan::text like '%23:45:00%';
我有这样的数据:
ID | timespan
------ | ------
1 | 12 days 23:45:00
2 | 02:45:00
3 | 23:45:00
4 | 10 days 03:30:00
我想排除包含 23:45:00 的每个时间跨度 所以我得到了这个输出
ID | timespan
------ | ------
2 | 02:45:00
4 | 10 days 03:30:00
where子句应该怎么写?
with data(id, timespan) as (
values
( 1, '12 days 23:45:00'::interval),
( 2, '02:45:00'),
( 3, '23:45:00'),
( 4, '10 days 03:30:00')
)
select *
from data
where timespan::text like '%23:45:00%';