Given the following sample tables:
Table 1(Activity This is activity table which is send to the clients):
Expand|Select|Wrap|Line Numbers
- ID sendingid list fromaccount
- 1 a1 user_new1 noreply@example.com
- 2 a2 user_new1 noreply@example.com
- 3 a3 user_new2 noreply@example.com
- 4 a4 user_new4 noreply@example.com
Expand|Select|Wrap|Line Numbers
- ID trackingid emails
- 1 a1 myexampla@gmail.com
- 2 a2 example@hotmail.com
- 3 a3 newexample@yahoo.com
- 4 a4 simpler@gmail.com
Expand|Select|Wrap|Line Numbers
- ID fname emails price
- 1 John myexampla@gmail.com 10
- 2 Bill example@hotmail.com 20
- 3 sami newexample@yahoo.com 20
- 4 daweoo simpler@gmail.com 20
first i will find unique email address from tracking table then i find to which list of the activity table it is send,
then i will delete that record from list say user_new1 and move it to another temprary table