My query as follows
select First.course,second.Certificate_No,second.Issue_Authority,second.Issue_Date
from
(select distinct Course = case cr.cpm_pkg_id WHEN '' THEN cr.cmn_minor_code else cbm.cmn_minor_code end
from course_registration cr, batch_course_registration bcr, co_batch_master cbm where
bcr.cr_bill_no = cr.cr_bill_no and cbm.cbm_batch_id = bcr.bcr_batch_id and cr.cr_active = 'A' and
cr.stud_id = '9917') as first
left join
(select distinct b.courseelg,b.coursename,a.pm_prof_code as Code,a.sp_cert_no as Certificate_No,
a.sp_issu_authority as Issue_Authority, convert(char(14),a.sp_issu_dt,106) as Issue_Date from student_professional a,tb_courseelg_settings b
where a.pm_prof_code= b.courseelg and first.course = b.coursename and a.stud_id = '9917' ) as second
ON(second.coursename=first.Course)