i have a mysql table \"bf_monthly_bill\" in which data against each users from another table \"bf_users\" is stored month wise.
Structure of my bf_users table is
<
You can try using conditional aggregation
select display_name,
sum(case when bill_month='Jan2k19' then package_price end) as first_bill,
sum(case when bill_month='Feb2k19' then package_price end) as second_bill,
sum(case when bill_month='Mar2k19' then package_price end) as third_bill
from
(
SELECT u.display_name,b.package_price,b.bill_month
from bf_users u inner join bf_monthly_bill b on u.id=b.company_id
)A group by display_name