Hey guys, I am really messing up with this. I tried this but it failed. I have following three tables with user polard searched 2 times at different days, with increased friends in second search in table b. I just need to build the query which will give me the two newly added friends (wont be present in end of list of second search). In table c there will be 20 friends of polard displayed with usid 1 and then 22 friends with usid 2 means total records will be 42.
table a
uid name
1 karos
2 polard
table b
usid umid name friends
1 2 polard 20
2 2 polard 22
table c
usrid usid name friends
1 1 hansy 10
2 1 boje 23
. . . .
. . . .
Your help will be geatly appreciated.
Thank you in advance.
Is this what you are looking for?
If you want both the usid values to be dynamic as well, assuming that you need to do for the latest usid for polard, it might be something like
This is assuming that the usid values are integer incrementing values specific for each umid in table b.
If they arent, then it will be a bit more complicated as you need to do an Order by and get the 2nd to last umid value