string(815) "
SELECT a.ID, b.meta_value*1 as med_license,
d.meta_value as doctor_status
FROM wp_posts a
INNER JOIN wp_postmeta b ON a.ID = b.post_id AND b.meta_key = '_med_license_number'
INNER JOIN wp_postmeta c ON a.ID = c.post_id AND c.meta_key = '_internal_id' AND c.meta_value IN (36181833,36181807)
INNER JOIN wp_postmeta d ON a.ID = d.post_id AND d.meta_key = '_doctor_staus_order'
WHERE a.post_status = 'publish'
AND a.post_type ='bch_doctor'
GROUP BY a.ID
ORDER BY
doctor_status ASC,
med_license ASC
"