By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
with commerce_order as (
select
1 as id
, 1639317660 as changed
, 1639317720 as created
)
select *
, from_unixtime(changed) as changed_dt
, from_unixtime(created) as created_dt
from commerce_order
where changed between unix_timestamp('2021-12-01 07:00') and unix_timestamp('2022-01-01 07:00')
and cast(date_format(from_unixtime(created), '%Y-%m-%d %H:%i') AS datetime) = cast(date_format(from_unixtime(changed), '%Y-%m-%d %H:%i') AS datetime) + interval 1 minute
id | changed | created | changed_dt | created_dt |
---|---|---|---|---|
1 | 1639317660 | 1639317720 | 2021-12-12 14:01:00 | 2021-12-12 14:02:00 |