Friday, February 18, 2011

institute list with city

SELECT ISI.INST_ID,II.INST_NAME,CM.COURSE_NAME,SCM.SUB_COURSE_NAME,
RIGHT(II.INST_PHONE, LEN(II.INST_PHONE) - 4) AS INST_PHONE,
RIGHT(II.INST_MOBILE, LEN(II.INST_MOBILE)-4) AS INST_MOBILE,
II.INST_ADDR_1,II.INST_ADDR_2,II.INST_CONTACT_NAME,CIM.CITY_NAME FROM INST_SUBCOURSE_INFO ISI
INNER JOIN INST_INFO II ON II.INST_ID = ISI.INST_ID
INNER JOIN COURSE_MST CM ON CM.COURSE_ID = ISI.COURSE_ID
INNER JOIN SUB_COURSE_MST SCM ON SCM.SUB_COURSE_ID = ISI.SUB_COURSE_ID
INNER JOIN CITY_MST CIM ON CIM.CITY_ID = II.INST_CITY_ID
WHERE II.INST_STATUS=1 AND ISI.inst_course_status=1 AND CM.COURSE_STATUS=1 AND SCM.SUB_COURSE_STATUS=1

ORDER BY II.INST_ID