我想使用sql server显示数据库的教师评级 [英] i want to show the faculty rating from the database using sql server

查看:88
本文介绍了我想使用sql server显示数据库的教师评级的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的查询如下;



My query as follows;

 SELECT F.facname, 
       BA.examdate, 
       FD.bfid, 
       FD.rate 
FROM   faculty F 
       JOIN bthfac B 
         ON F.facid = B.facid 
       JOIN facfeedback FD 
         ON FD.bfid = B.bfid 
       JOIN batch BA 
         ON BA.bthid = B.bthid 	







当我执行上述查询时,显示错误如下;



转换数据类型varchar时出错to bigint。





教师表数据库结构如下;




when i execute the above query, shows error as follows;

Error converting data type varchar to bigint.


faculty table database structure as follows;

FacId         bigint
FacName   varchar
Fac_active    char(1)





bthfac表数据库结构如下;



bthfac table database structure as follows;

BFid     bigint
BthId    bigint
FacId    varchar(40)







facfeedback table数据库结构如下;




facfeedback table database structure as follows;

BFid  bigint
Rate   int





批处理表数据库结构如下;



Batch table database structure as follows;

 BthId	    bigint	
Examdate   datetime





我上面的查询有什么问题。



请帮帮我。



问候,

narasiman P.



what is the problem in my above query.

please help me.

regards,
narasiman P.

推荐答案

你问的是:

You issue is this:
FacId	 varchar(40)	



执行此操作后的结果:


as a result when you do this:

ON F.facid = B.facid 



你试图将Varchar(40)与Bigint进行比较,你不能。因此你的错误。


you are trying to compare a Varchar(40) with a Bigint which you cannot. Hence your error.


这篇关于我想使用sql server显示数据库的教师评级的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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