博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
pl/sql中的赋值运算符_如何在SQL中使用AND / OR运算符?
阅读量:2530 次
发布时间:2019-05-11

本文共 2543 字,大约阅读时间需要 8 分钟。

pl/sql中的赋值运算符

Basically, AND / OR operator is used to retrieving the record from the database. If we give more than one conditions by using AND Operator, then it retrieves the data from the database when both the conditions are true. And if we use OR operator it retrieves data from the database in both cases either one or more condition is true. Here, in this example we use table 1 for retrieving data using AND, OR operator:

基本上, AND / OR运算符用于从数据库检索记录。 如果我们使用AND运算符给出多个条件,则当两个条件都为真时,它将从数据库中检索数据。 而且,如果我们使用OR运算符,则在两种或两种情况下,它都从数据库中检索数据。 在此示例中,我们使用表1使用AND,OR运算符检索数据:

Example:

例:

Table 1:

表格1:

Student_ID Student_Name Dept Branch Course
15011 AmanGautam CSE IT B.tech
15028 AtulAnand CSE CS B.tech
15032 Bharti Parmar CSE CS B.tech
15068 Partha Biswas CSE IT B.tech
学生卡 学生姓名 部门 课程
15011 阿曼·高塔姆(AmanGautam) 自学考试 科技
15028 阿图拉南德 自学考试 CS 科技
15032 巴尔蒂·帕玛(Bharti Parmar) 自学考试 CS 科技
15068 帕萨·比斯瓦斯(Partha Biswas) 自学考试 科技

1) We have to find the Student_Name whose Dept is CSE and Branch is CS using SQL query.

1)我们必须使用SQL查询来找到其Dept为CSE且Branch为CS的Student_Name。

SQL | AND/OR Query Example 1

2) We have to find the Student_Name whose Dept is CSE OR Branch is CS using SQL query.

2)我们必须使用SQL查询来找到其Cept或Branch是CS的Student_Name。

SQL | AND/OR Query Example 2

Table 2:

表2:

Student_ID HOD Dean
15011 Shivani rajpoot Aditya sikarwar
15028 Sanchita nayak Aditya Sikarwar
15032 Sanchita nayak RK sharma
15068 Shivani rajpoot RK sharma
学生卡 HOD 院长
15011 西瓦尼·拉布波特 阿迪亚·西卡瓦尔(Aditya sikarwar)
15028 Sanchita nayak 阿迪亚(Aditya Sikarwar)
15032 Sanchita nayak RK夏尔马
15068 西瓦尼·拉布波特 RK夏尔马

Here, in this example we use two table which are join by primary and foreign key for retrieving data using AND OR operator.

在此示例中,我们使用两个表(通过主键和外键联接)使用AND OR运算符检索数据。

1) We have to find the Student_Name, HOD whose Dean is R. K Sharma and Branch is CS using SQL query.

1)我们必须使用SQL查询来找到其Dean为R. K Sharma而Branch为CS的Student_Name,HOD。

SQL | AND/OR Query Example 3

2) We have to find the Student_Name, Dean where HOD is shivani rajpoot using SQL query.

2)我们必须使用SQL查询找到Student_Name,Dean,其中HOD是shivani rajpoot。

SQL | AND/OR Query Example 4

Conclusion:

结论:

In this article, we are using AND OR operator to retrieve data from the database/table. Also, we see the example of how to retrieve data from the single table or more than one table. I hope you understand the concept; if you have any query, feel free to ask in the comment section. I will be trying to give you an answer of your question as soon as possible. We will know more about SQL in the upcoming article.

在本文中,我们使用AND OR运算符从数据库/表中检索数据。 另外,我们看到了如何从单个表或多个表中检索数据的示例。 希望您理解这个概念; 如果您有任何疑问,请随时在评论部分提问。 我将尽力为您解答。 在下一篇文章中,我们将更多地了解SQL。

翻译自:

pl/sql中的赋值运算符

转载地址:http://pmxzd.baihongyu.com/

你可能感兴趣的文章
两台电脑如何实现共享文件
查看>>
组合模式Composite
查看>>
程序员最想得到的十大证件,你最想得到哪个?
查看>>
我的第一篇CBBLOGS博客
查看>>
【MyBean调试笔记】接口的使用和清理
查看>>
07 js自定义函数
查看>>
jQueru中数据交换格式XML和JSON对比
查看>>
form表单序列化后的数据转json对象
查看>>
[PYTHON]一个简单的单元測试框架
查看>>
iOS开发网络篇—XML数据的解析
查看>>
[BZOJ4303]数列
查看>>
一般处理程序在VS2012中打开问题
查看>>
C语言中的++和--
查看>>
thinkphp3.2.3入口文件详解
查看>>
POJ 1141 Brackets Sequence
查看>>
Ubuntu 18.04 root 使用ssh密钥远程登陆
查看>>
Servlet和JSP的异同。
查看>>
虚拟机centOs Linux与Windows之间的文件传输
查看>>
ethereum(以太坊)(二)--合约中属性和行为的访问权限
查看>>
IOS内存管理
查看>>