SELECT distinct purchased_plots.plot_id,purchased_plots.purchase_id, tcmu.username, pmpf.planted_for , pmpf.planted_for_city, pmpf.planted_for_state, pmpf.planted_for_country , pmpf.admin_approve as pmpf_admin_approve, tcma.city, tcma.state, tcma.county FROM `plot_post` left join purchased_plots on plot_post.purchase_id=purchased_plots.purchase_id left join tbl_cwc_merchant_users tcmu on tcmu.user_id=plot_post.user_id left join tbl_cwc_merchant_addresses tcma on tcma.merchant_id=tcmu.merchant_id left join plot_msg_plnt_fr pmpf on pmpf.purchase_id=purchased_plots.purchase_id where plot_post.admin_approve=1 and ((plot_post.type=2 and plot_post.user_approve=1) or plot_post.type=1) and purchased_plots.purchase_id='' json['plot']['parent_plot_details']['purchase_id'] '' order by purchased_plots.plot_id asc