I have the following query:
SELECT a.*
FROM `user_subscription_history` a
LEFT JOIN `transaction` b ON b.tran_date=a.date_time
b.tran_date and a.date_time are both timestamps. I'd like the join to return the closest matching. Currently only returns if matching.
How do i solve this?