Activity table rehearse
id (self-incrementing id), name (activity name), send_time (start time), uid (user ID that created the activity)...
Statistical table status
id (self-incrementing id), mtype (activity type 1, 2, 3; 1 represents the activity in the table rehearse), sid (source id, id of the activity table), pid (person id), open_time (open mail time)...
Query the activity list created by the user with user ID 6 (including information: activity name, start time, total number of emails, total number of opened emails)
open_time>0 is the record of open emails, fixed condition mtype =1,sid= The active table id queried from rehearse through uid=6.
Now the query is performed separately, and then the array is processed.
I don’t know how to check the required data in a sql. Ask God for help
Since the left link is connected twice, there may be efficiency issues. I am looking for a better way
Update
Method 2: Subquery