Click here to Skip to main content
15,919,879 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
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 = 425) 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 = 425) as second
ON(second.coursename=first.Course)


When i run the above query shows error as follows
The multi-part identifier "first.course" could not be bound.

From my query what is the mistake i made.
Posted

1 solution

Hi,

try below query

select First.course,second.Certificate_No,second.Issue_Authority,second.Issue_Date
from
(select distinct case cr.cpm_pkg_id WHEN '' THEN cr.cmn_minor_code else cbm.cmn_minor_code end as Course
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 = 425) 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 = 425) as second
ON(second.coursename=first.Course)

Let us know if you face any issue..

hope this will help you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900