SELECT ppmap_d.*, p_prob.*, ppmap_h.*, p_probgroup.*,
p_prod.*, ppmap_d.prob_id AS probid, ppmap_d.map_id AS mapid,
ppmap_h.pg_name AS probgname, ppmap_h.m_id AS modelid
FROM p_prob
INNER JOIN p_prod ON ppmap_d.prob_id = p_probgroup.prob_id
INNER JOIN ppmap_h ON ppmap_h.map_id = ppmap_d.map_id AND ppmap_h.pg_name = p_probgroup.pg_name
INNER JOIN ppmap_d ON p_prod.m_id = ppmap_h.m_id
INNER JOIN p_probgroup ON p_prob.prob_id = p_probgroup.prob_id;
4
solved MS SQL query not working on MySQL [closed]