Mysql – How to get the records of X and its referrals in one query?
I have got 3 tables. Orders Clients Referrals ----- ----- ----- id id id total_price name name receiver_client_id status client_id While adding order, sometimes the receiver is CLIENT, sometimes REFERRAL, so receiver_client_id can have both client_id or referral_id. Referrals are…