with base as
(
select
date(from_unixtime(ctime - 3600)) as grass_date,
shop_id,
status,
item_id,
data.fields as fields
from shopee_vn.shopee_item_audit_log_db__item_audit_tab
where country = 'VN'
and from_unixtime(ctime - 3600) >= date'2021-06-01'
),
unnested as
(
select
grass_date,
base.shop_id,
status,
item_id,
f.name,
f.old,
f.new
from base
left join unnest (base.fields) as f(name, old, new) on true
)
select *
from unnested
where name = 'price_before_discount'
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter