pl/sql中的赋值运算符_如何在SQL中使用AND / OR运算符?
pl/sql中的賦值運(yùn)算符
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運(yùn)算符用于從數(shù)據(jù)庫檢索記錄。 如果我們使用AND運(yùn)算符給出多個(gè)條件,則當(dāng)兩個(gè)條件都為真時(shí),它將從數(shù)據(jù)庫中檢索數(shù)據(jù)。 而且,如果我們使用OR運(yùn)算符,則在兩種或兩種情況下,它都從數(shù)據(jù)庫中檢索數(shù)據(jù)。 在此示例中,我們使用表1使用AND,OR運(yùn)算符檢索數(shù)據(jù):
Example:
例:
Table 1:
表格1:
| 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) | 自學(xué)考試 | 它 | 科技 |
| 15028 | 阿圖拉南德 | 自學(xué)考試 | CS | 科技 |
| 15032 | 巴爾蒂·帕瑪(Bharti Parmar) | 自學(xué)考試 | CS | 科技 |
| 15068 | 帕薩·比斯瓦斯(Partha Biswas) | 自學(xué)考試 | 它 | 科技 |
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。
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。
Table 2:
表2:
| 15011 | Shivani rajpoot | Aditya sikarwar |
| 15028 | Sanchita nayak | Aditya Sikarwar |
| 15032 | Sanchita nayak | RK sharma |
| 15068 | Shivani rajpoot | RK sharma |
| 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.
在此示例中,我們使用兩個(gè)表(通過主鍵和外鍵聯(lián)接)使用AND OR運(yùn)算符檢索數(shù)據(jù)。
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。
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。
Conclusion:
結(jié)論:
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運(yùn)算符從數(shù)據(jù)庫/表中檢索數(shù)據(jù)。 另外,我們看到了如何從單個(gè)表或多個(gè)表中檢索數(shù)據(jù)的示例。 希望您理解這個(gè)概念; 如果您有任何疑問,請(qǐng)隨時(shí)在評(píng)論部分提問。 我將盡力為您解答。 在下一篇文章中,我們將更多地了解SQL。
翻譯自: https://www.includehelp.com/sql/use-AND-OR-operator-in-sql.aspx
pl/sql中的賦值運(yùn)算符
總結(jié)
以上是生活随笔為你收集整理的pl/sql中的赋值运算符_如何在SQL中使用AND / OR运算符?的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: cf防化盾怎么用
- 下一篇: 在SQL中使用DEFAULT约束