用 bi_t_ope_order 中的 ORDER_ID 查询 bi_tab_ope_handover_detail得到 handoverId(会有多个,取第一个) 用 handoverId(第一个) 在 bi_tab_ope_start_car_detail中查询得到id 用id 在bi_tab_ope_start_car查询得到 startCarTime
select handoverId
from bi_tab_ope_handover_detail
where ORDER_ID in (select ORDER_ID from bi_t_ope_order)
limit 1
SELECT * FROM (SELECT ROW_NUMBER() OVER(PARTITION BY x ORDER BY y DESC) rn, test1.* FROM test1) WHERE rn = 1 ;
这样?