I have one table
ID Details User_id Last_ID
2960 ABC 52294
10532 PQR 61629 61629
11050 XYZ 69
and other
Id UserName
69 aaaa
52294 bbbb
61629 cccc
Please provide a query to get following data
ID Details UserName last_id