如何在sql server中编写查询 [英] how to write the query in sql server

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

问题描述

在数据库记录中如下



名称移动课程



A 9940567890 RAC

B 9945454895 ROC

C 9945045451 SAC





从以上记录中我想展示只有RAC和ROC课程名称和手机。





我怎么能写这个查询





请帮帮我





Rgds,

Narasiman P.

解决方案

这有用吗?

 选择 * 来自 TableName 其中​​课程 in '  RAC''   ROC'


尝试:

< pre lang =SQL> SELECT 名称,Mobile FROM myTable WHERE Course = ' RAC' OR Course = ' ROC'


In database records as follows

Name Mobile Course

A 9940567890 RAC
B 9945454895 ROC
C 9945045451 SAC


From the above record i want to show only the RAC and ROC Course Name and Mobile.


for that how can i write the query


Please help me


Rgds,
Narasiman P.

解决方案

Does this helpls ?

select  * from TableName where Course in ('RAC','ROC')


Try:

SELECT Name, Mobile FROM myTable WHERE Course='RAC' OR Course='ROC'


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

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