如何替换 Bigquery 中的 Qualify 关键字
How to replace Qualify key word in Big Query
BigQuery 中的等价物是什么。我的 TD 查询在下面,我试图形成一个等效的 BQ
select cast(pol.ORDER as int) as target
from db.porder po
inner join db_line pol
on po.po_nbr = pol.po_nbr
and po.order_date = pol.order_date
qualify row_number() over (partition by po.po_nbr order by po.order_date desc) = 1
where
po.po_nbr = '12345'
and pol.LINE_NBR = 1
假设您的查询在 TD 中有效 - 在 BQ 中尝试以下
select cast(pol.ORDER as int) as target
from db.porder po
inner join db_line pol
on po.po_nbr = pol.po_nbr
and po.order_date = pol.order_date
where
po.po_nbr = '12345'
and pol.LINE_NBR = 1
qualify row_number() over (partition by po.po_nbr order by po.order_date desc) = 1
在 BQ
中查看 QUALIFY clause
BigQuery 中的等价物是什么。我的 TD 查询在下面,我试图形成一个等效的 BQ
select cast(pol.ORDER as int) as target
from db.porder po
inner join db_line pol
on po.po_nbr = pol.po_nbr
and po.order_date = pol.order_date
qualify row_number() over (partition by po.po_nbr order by po.order_date desc) = 1
where
po.po_nbr = '12345'
and pol.LINE_NBR = 1
假设您的查询在 TD 中有效 - 在 BQ 中尝试以下
select cast(pol.ORDER as int) as target
from db.porder po
inner join db_line pol
on po.po_nbr = pol.po_nbr
and po.order_date = pol.order_date
where
po.po_nbr = '12345'
and pol.LINE_NBR = 1
qualify row_number() over (partition by po.po_nbr order by po.order_date desc) = 1
在 BQ
中查看 QUALIFY clause