sql运算符
When you have multiple conditions to be checked, we can use IN operator instead of it. It specifies the multiple values in a WHERE clause.
当您有多个条件要检查时,我们可以使用IN运算符代替它。 它在WHERE子句中指定多个值。
Syntax:
句法:
SELECT column_name FROM table_name WHERE column_name IN (value1… valueN);
Example:
例:
Table 1:
表格1:
customer_ID | customer_Name | Address | city | Country |
---|---|---|---|---|
3 | Aman Gautam | Roxy | Gwalior | India |
2 | Atul Anand | Vinay nagar | Gwalior | India |
1 | Bharti Parmar | Sapta | Bihar | India |
4 | Partha Biswas | Tripura | West bengal | India |
顾客ID | 顾客姓名 | 地址 | 市 | 国家 |
---|---|---|---|---|
3 | 阿曼·高塔姆(Aman Gautam) | 乐声 | 瓜廖尔 | 印度 |
2 | 阿图尔·阿南德(Atul Anand) | Vinay Nagar | 瓜廖尔 | 印度 |
1个 | 巴尔蒂·帕玛(Bharti Parmar) | 萨帕塔 | 比哈尔 | 印度 |
4 | 帕萨·比斯瓦斯(Partha Biswas) | 特里普拉 | 西孟加拉邦 | 印度 |
Query to find customer_name and address where city is bihar
查询以查找customer_name和比尔所在城市的地址
![IN Operator](https://i-blog.csdnimg.cn/blog_migrate/05550ccc5bd3eb17fcbaf71c9123b5d5.png)
Conclusion:
结论:
In this article, we have learnt how to use IN Operator? I hope you understand the concept; if you have any query, feel free to ask in the comment section.
在本文中,我们学习了如何使用IN运算符? 希望您理解这个概念; 如果您有任何疑问,请随时在评论部分提问。
翻译自: https://www.includehelp.com/sql/in-operator-with-example.aspx
sql运算符