pl/sql中的赋值运算符_如何在SQL中使用AND / OR运算符?

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_IDStudent_NameDeptBranchCourse
15011AmanGautamCSEITB.tech
15028AtulAnandCSECSB.tech
15032Bharti ParmarCSECSB.tech
15068Partha BiswasCSEITB.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_IDHODDean
15011Shivani rajpootAditya sikarwar
15028Sanchita nayakAditya Sikarwar
15032Sanchita nayakRK sharma
15068Shivani rajpootRK 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。

翻译自: https://www.includehelp.com/sql/use-AND-OR-operator-in-sql.aspx

pl/sql中的赋值运算符

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/377744.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

【C++grammar】名字隐藏与重定义

目录1、继承中的名字隐藏1.基类同名函数被隐藏的现象描述2.问题理解3.避免现象2、重定义1.现象描述2.重定义与重载的区别3.能否使用 using 将基类成员引入到派生类定义中1、继承中的名字隐藏 1.基类同名函数被隐藏的现象描述 在学习变量作用域的时候知道,全局变量…

javascript 核心概念(1)-数据类型

语法 (1)到现在为止,大多数浏览器也还是支持到ECMAScript 第三版的标准。 核心概念就是一个语言的基本工作原理,涉及语法,操作符,数据类型。 (2)javascript的一切--变量,…

注解的力量 -----Spring 2.5 JPA hibernate 使用方法的点滴整理(五):使用@Component 来简化bean的配置...

虽然我们可以通过 Autowired 在 Bean 类中使用自动注入功能&#xff0c;但是 Bean 还是在 applicatonContext.xml 文件中通过 <bean> 进行定义 —— 在前面的例子中&#xff0c;我们还是在配置文件中定义 Bean&#xff0c;通过 Autowired为 Bean 的成员变量、方法形参或构…

c语言条件语句示例_PHP中的条件语句和示例

c语言条件语句示例PHP条件语句 (PHP Conditional Statements) While coding, you may get to a point where your results can only be gotten when a condition is valid. We make use of conditional statements. Conditional statements are statements that can only be ex…

十四、聚类实战——图片压缩

对同一像素点值的像素点归为一类&#xff0c;通过平均值进行取代&#xff0c;从而将图像进行压缩并且保证图像尽可能不失真&#xff0c;关键信息仍保留。 from PIL import Image import numpy as np from sklearn.cluster import KMeans import matplotlib import matplotlib.…

步骤菜单使用css3实现

代码库&#xff1a;http://thecodeplayer.com/walkthrough/css3-breadcrumb-navigation 有兴趣的可以看一下&#xff0c;看完绝对让你大饱眼福。首先截图&#xff0c;看效果看着很酷吧&#xff0c;其实实现起来也不是很难&#xff0c;里边需要用的技术有:box-shadow,计数器&…

【嵌入式系统】STM32串口通信的四种方法(基于RTOS)

目录1、串行通信的基本参数2、轮询方式代码效果3、中断方式代码效果4、中断加上时间戳方式代码及效果5、DMA空闲中断方式接收数据1、串行通信的基本参数 串行端口的通信方式是将字节拆分成一个接一个的位再传输出去&#xff0c;接收方再将此一个一个的位组合成原来的字符&…

大数据 java 代码示例_Java变量类型与示例

大数据 java 代码示例Java变量 (Java variables) Variables are the user-defined names of the memory blocks, and their values can be changed at any time during program execution. They play an important role in a class/program as they help in to store, retrieve…

毕业设计

位置跟踪系统工作原理&#xff08;博闻网&#xff09; http://science.bowenwang.com.cn/location-tracking.htm Azuma是这样定义增强现实的 :虚实结合 ,实时交互 ,三维注册 环境搭建&#xff1a; http://cvchina.net/thread-173-1-1.html http://blog.csdn.net/jdh99/article/…

十五、聚类的评估

一、Given Label 均一性homogeneity&#xff1a;一个簇中只包含一个类别样本&#xff0c;Precision 完整性completeness&#xff1a;同类别样本被归到同一个簇中&#xff0c;Recall 将均一性h和完整性c进行结合(二者加权平均)得到V-Measure&#xff0c;&#xff0c;β为权重 …

SQL SERVER作业的Schedules浅析

SQL SERVER作业的计划&#xff08;Schedules&#xff09;&#xff0c;如果你没仔细研究过或没有应用一些复杂的计划&#xff08;Schedules&#xff09;&#xff0c;那么你觉得SQL SERVER作业的计划(Schedules)非常好用&#xff0c;也没啥问题&#xff0c;但是我要告诉你一个“残…

leetcode 51. N 皇后 思考分析

目录题目思考AC代码题目 n 皇后问题研究的是如何将 n 个皇后放置在 nn 的棋盘上&#xff0c;并且使皇后彼此之间不能相互攻击。 思考 首先以N4为例&#xff0c;画出解空间树的一部分&#xff1a; 根据模板&#xff1a; void backtracking(参数) {if(终止条件){存放结果…

Django实战(18):提交订单

前面的内容已经基本上涵盖了Django开发的主要方面&#xff0c;我们从需求和界面设计出发&#xff0c;创建模型和修改模型&#xff0c;并通过scaffold作为开发的起点&#xff1b;在scaffold的基础上重新定制模板&#xff0c;并且通过Model类和Form类对用户输入的数据进行校验。我…

No module named ‘tensorflow.examples‘解决方案

想从tensorflow中导入mnist手写数字数据集&#xff0c;结果报错 from tensorflow.examples.tutorials.mnist import input_data import tensorflow.compat.v1 as tf tf.disable_v2_behavior()my_mnist input_data.read_data_sets("MNIST_data_bak/", one_hotTrue)&…

julia example_使用Julia中的Example的sign()函数

julia exampleJulia| sign()函数 (Julia | sign() function) sign() function is a library function in Julia programming language, it returns the sign of the given value in the form of -1/1. sign()函数是Julia编程语言中的库函数&#xff0c;它以-1 / 1的形式返回给…

.NET通用基本权限系统

DEMO下载地址&#xff1a; http://download.csdn.net/detail/shecixiong/5372895 一、开发技术&#xff1a;B/S(.NET C# ) 1、Windows XP以上 (支援最新Win 8) 2、Microsoft Visual Studio 2010/2012 C#.NET 3、.NET Framework 4.0以上 (支援最新4.5版本) 4、SQL Server 2005以…

leetcode 37. 解数独 思考分析

目录题目核心思路的不断细化1、核心框架2、考虑到每个位置的工作3、考虑到到达最后一列、该位置的数已经预置的情况4、判断是否符合规则的函数5、确定递归终止条件确定函数返回值AC代码题目 编写一个程序&#xff0c;通过填充空格来解决数独问题。 一个数独的解法需遵循如下规…

快速完成兼职外包开发任务

做了很多年的开发相关的工作&#xff0c;做过兼职开发&#xff0c;也做过外包一些开发项目。 兼职人员角色时 正是经历这些事情时&#xff0c;每次就要提前很费经的跟公司沟通&#xff0c;让他们把公司内部的svn开发出去&#xff0c;但是就是很难&#xff0c;会涉及到安全各方的…

使用YOLOv5训练NEU-DET数据集

一、下载YOLOv5源码和NEU-DET(钢材表面缺陷)数据集 YOLOv5源码 NEU-DET(钢材表面缺陷)数据集 这里的数据集已经经过处理了&#xff0c;下载即可 若通过其他途径下载的原始数据集标签为xml格式&#xff0c;需要转化为txt格式XML转txt格式脚本 二、数据集准备 NEU-DET(钢材表…

kotlin获取属性_Kotlin程序获取系统MAC地址

kotlin获取属性The task is to get system MAC address. 任务是获取系统MAC地址。 package com.includehelpimport java.net.InetAddressimport java.net.NetworkInterface//Function to get System MACfun getSystemMac(): String? {return try {val OSName System.getProp…