liyuheng55555 commented on code in PR #9438:
URL: https://github.com/apache/iotdb/pull/9438#discussion_r1159274608


##########
docs/UserGuide/Operators-Functions/Conditional.md:
##########
@@ -0,0 +1,151 @@
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+
+## Conditional Expressions
+
+### CASE
+
+#### Introduction
+
+The CASE expression is similar to the if/else statement in other languages.
+
+The syntax is as follows:
+
+- Format 1:
+    ```sql
+    CASE 
+        WHEN condition1 THEN expression1
+        [WHEN condition2 THEN expression2] ...
+        [ELSE expression_end]
+    END
+    ```
+  The `condition`s are evaluated one by one. 
+- The first `condition` that is true will return the corresponding 
`expression`.
+- 格式2:
+    ```sql
+    CASE caseValue
+        WHEN whenValue1 THEN expression1
+        [WHEN whenValue2 THEN expression2] ...
+        [ELSE expression_end]
+    END
+    ```
+  The `caseValue` is evaluated first, and then the `whenValue`s are evaluated 
one by one. The first `whenValue` that is equal to the `caseValue` will return 
the corresponding `expression`.
+
+  Format 2 will be transformed into an equivalent Format 1 by iotdb. 
+  For example, the above SQL statement will be transformed into:
+    ```sql
+    CASE 
+        WHEN caseValue=whenValue1 THEN expression1
+        [WHEN caseValue=whenValue1 THEN expression1] ...
+        [ELSE expression_end]
+    END
+    ```
+
+如果condition均不为真,或均不满足caseVaule=whenValue,则返回expression_end;不存在ELSE子句则返回null。

Review Comment:
   done.



##########
docs/UserGuide/Operators-Functions/Conditional.md:
##########
@@ -0,0 +1,151 @@
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+
+## Conditional Expressions
+
+### CASE
+
+#### Introduction
+
+The CASE expression is similar to the if/else statement in other languages.
+
+The syntax is as follows:
+
+- Format 1:
+    ```sql
+    CASE 
+        WHEN condition1 THEN expression1
+        [WHEN condition2 THEN expression2] ...
+        [ELSE expression_end]
+    END
+    ```
+  The `condition`s are evaluated one by one. 
+- The first `condition` that is true will return the corresponding 
`expression`.
+- 格式2:

Review Comment:
   done.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to