I'm trying to create a timeline of action that the user did (when I use his email address).
I've 3 tables I want to use in my timeline:
So, the only common point is the email address (and the column has a different name in each table).
I've tried a lot of solutions but they didn't work with my case.
You can use a UNION like:
SELECT Email, DateTime FROM
(SELECT landing_email as Email, landing_date as DateTime FROM landing
UNION
SELECT tracker_email as Email, tracker_date as DateTime FROM tracker
UNION
SELECT links_email as Email, links_date as DateTime FROM links)
WHERE EMAIL='user@domain.com'
ORDER BY DateTime;
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.