关于sql查询的问题 [英] question about sql query

查看:105
本文介绍了关于sql查询的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,我有一个查询

我有一个表格程序员,其字段是

pname

proficiancy1和

proficiancy2



我希望此表中的数据

计算其proficeancy1 = c或proficiancy2 = c <的prohramer的数量br />


我在那里触发计数查询但是在saprare列上并且检索了2个不同的计数但是我只想要一个计数作为输出怎么办?

解决方案

如何使用where子句?



  SELECT  COUNT(p.pname)
FROM 程序员 as p
WHERE
p.proficiancy1 = c p.proficiancy1 = c





因为我不知道你的问题所包含的一点点我真的不能说c是什么意思因为你没有注意告诉我们熟练字段的类型。顺便说一下,你也忘了告诉我们你正在使用的RDBMS。您的标签ASP.net也没有真正的帮助。



问候,

- Manfred

hello i have one query
I have one table programer and its fields are
pname
proficiancy1 and
proficiancy2

and i want the data from this table that
count the number of prohramer whose proficeancy1 = c or proficiancy2=c

I fire the count query in that but on saprare column and retrive 2 different count but i want only one count as output how to do?

解决方案

How about using a where clause?

SELECT COUNT(p.pname)
FROM programmer as p
WHERE  
    p.proficiancy1 = c OR p.proficiancy1 = c  



Since I have no clue from the little that your question contained I can not really say what c is supposed to be since you didn't take care to tell us what type the "proficiency" fields are made of. BTW, you also forgot to tell us the kind of RDBMS you are using. Your tag "ASP.net" doesn't really help either.

Regards,

— Manfred


这篇关于关于sql查询的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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