[英]Need help on Databricks SQL query
您需要兩個單獨的函數來表示運行在同一個 window 上的開始日期和狀態:
SELECT distinct order_id,
first(start_date) over (partition by order_id order by start_date
rows between unbounded preceding and unbounded following) as start_date,
last(status) over (partition by order_id order by start_date
rows between unbounded preceding and unbounded following) as status
FROM a_table;
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.