I've the following result returned by a mysql function named GetFamilyTree
565,586,579,587,596,591,594,595
and another table named salary contains the following
+------+-------+
| uid | sal |
+------+-------+
| 565 | 10000 |
| 568 | 20000 |
| 587 | 15000 |
| 595 | 7000 |
| 596 | 40000 |
+------+-------+
I need the total salary of all the members.
I do not want to use a temporary table.
I've tried the following so far without success
select sum(sal) from salary where uid in (select GetFamilyTree('550'))
Please tell me how to do it.