当我运行查询时显示错误多部分标识符“First.Course”无法绑定。 [英] When I Run The Query Shows Error The Multi-Part Identifier "First.Course" Could Not Be Bound.

查看:72
本文介绍了当我运行查询时显示错误多部分标识符“First.Course”无法绑定。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的查询如下



选择First.course,second.Certificate_No,second.Issue_Authority,second.Issue_Date

来自

(选择不同的Course = case cr.cpm_pkg_id WHEN''那么cr.cmn_minor_code else cbm.cmn_minor_code end

来自course_registration cr,batch_course_registration bcr,co_batch_master cbm其中

bcr.cr_bill_no = cr.cr_bill_no和cbm.cbm_batch_id = bcr.bcr_batch_id和cr.cr_active ='A'和

cr.stud_id = 425)作为第一个

left join

(选择不同的b.courseelg,b.coursename,a.pm_prof_code作为Code,a.sp_cert_no作为Certificate_No,

a.sp_issu_authority作为Issue_Authority,convert( char(14),a.sp_issu_dt,106)作为来自student_professional的Issue_Date a,tb_courseelg_settings b

其中a.pm_prof_code = b.courseelg和first.course = b.coursename和a.stud_id = 425)作为第二个

ON(second.coursename = first.Course)





当我运行a bove查询显示错误如下

多部分标识符first.course无法绑定。



从我的查询是什么我犯的错误。

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.

推荐答案

您好,



尝试以下查询



选择First.course,second.Certificate_No,second.Issue_Authority,second.Issue_Date

来自

(选择不同的案例cr.cpm_pkg_id WHEN ''那么cr.cmn_minor_code else cbm.cmn_minor_code结束为课程

来自course_registration cr,batch_course_registration bcr,co_batch_master cbm其中

bcr.cr_bill_no = cr.cr_bill_no和cbm.cbm_batch_id = bcr.bcr_batch_id和cr.cr_active ='A'和

cr.stud_id = 425)作为第一个

左加入

(选择截然不同b.courseelg,b.coursename,a.pm_prof_code为Code,a.sp_cert_no为Certificate_No,

a.sp_issu_authority为Issue_Authority,convert(char(14),a.sp_issu_dt,106)为Issue_Date from螺柱ent_professional a,tb_courseelg_settings b

其中a.pm_prof_code = b.courseelg和first.course = b.coursename和a.stud_id = 425)作为第二个

ON(第二个。 coursename = first.Course)



如果你遇到任何问题,请告诉我们..



希望这个会帮助你。
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.


这篇关于当我运行查询时显示错误多部分标识符“First.Course”无法绑定。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆