2020-06-08 05:29:08 +00:00
|
|
|
|
---
|
2022-08-26 19:07:59 +00:00
|
|
|
|
slug: /zh/sql-reference/functions/logical-functions
|
2022-04-10 23:08:18 +00:00
|
|
|
|
sidebar_position: 37
|
|
|
|
|
sidebar_label: 逻辑函数
|
2020-06-08 05:29:08 +00:00
|
|
|
|
---
|
|
|
|
|
|
2020-03-20 18:20:59 +00:00
|
|
|
|
# 逻辑函数 {#luo-ji-han-shu}
|
2019-05-05 17:38:05 +00:00
|
|
|
|
|
|
|
|
|
逻辑函数可以接受任何数字类型的参数,并返回UInt8类型的0或1。
|
|
|
|
|
|
2020-03-20 18:20:59 +00:00
|
|
|
|
当向函数传递零时,函数将判定为«false»,否则,任何其他非零的值都将被判定为«true»。
|
2019-05-05 17:38:05 +00:00
|
|
|
|
|
2020-06-08 05:29:08 +00:00
|
|
|
|
## 和,`AND` 运算符 {#and-and-operator}
|
2019-05-05 17:38:05 +00:00
|
|
|
|
|
2020-06-08 05:29:08 +00:00
|
|
|
|
## 或,`OR` 运算符 {#or-or-operator}
|
2019-05-05 17:38:05 +00:00
|
|
|
|
|
2020-06-08 05:29:08 +00:00
|
|
|
|
## 非,`NOT` 运算符 {#not-not-operator}
|
2019-05-05 17:38:05 +00:00
|
|
|
|
|
2020-06-08 05:29:08 +00:00
|
|
|
|
## 异或,`XOR` 运算符 {#xor}
|
2019-05-05 17:38:05 +00:00
|
|
|
|
|
2021-09-19 20:05:54 +00:00
|
|
|
|
[来源文章](https://clickhouse.com/docs/en/query_language/functions/logical_functions/) <!--hide-->
|