我想從名為 carpooling 的表中選擇所有條目,其中ends_on 和 start_on 之間的時間差為 1 小時,有人可以幫助我撰寫帶有解釋的查詢嗎?我在下面的鏈接中附上了圖片。
表參考
點擊這里查詢參考
uj5u.com熱心網友回復:
試試這個,將時間戳轉換為日期并按天減去
select *
from carpooling
where trunc(cast(ends_on as date),'mi')-trunc(cast(start_on as date),'mi')=1/24
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/461908.html
