User
UserLogin |UserName
------------------|------------
ken |Ken Tsang
lam |Lam Hui
king |Kington


Friend
UserLogin |UserFriend |IsFriendSingle
------------------|-----------|------------
ken |jenny |1
ken |mary |1
ken |mulri |0
lam |sue |1
lam |butt |0
lam |lihu |0
king |ming |1

Result Table
UserLogin |No of fd(single) |No of fd (not single)
------------------|-------------------|------------------|
ken |2 |1 |
lam |1 |2 |
king |1 |0 |

thx a lot!