题解 | #输出在5min内完成点击购买的用户ID#
输出在5min内完成点击购买的用户ID
https://www.nowcoder.com/practice/07c74663b484428da99b4769671d2d45
select c.user_id uid from user_ad_click_time c join user_payment_time p on c.trace_id = p.trace_id where substr(c.click_time,1,14) = substr(p.pay_time,1,14) and substr(c.click_time,15,2) - substr(p.pay_time,15,2) < 5 and substr(c.click_time,15,2) - substr(p.pay_time,15,2) > -5