i have a mysql table with fields
id user_id refer_user_id position
1 1 10 left
2 1 12 left
3 1 16 right
i want pair count for above table data , condition is one left and one right is one pair.
if i see above data here for user_id 1 three referral two positions are left and one position is right so as per condition i need return pair count 1, it will count only paired row(one left and one right is one pair) and will skip unpaired row / count.
any method you can use means in single mysql query you can do or by using php .
What I have tried:
i am confused how to do, i am trying mysql with group by , or count its returning result that not the correct that i want