The plus sign ( ) operator in Oracle can be used to: connect strings, numbers, dates and time intervals; handle NULL values and convert NULL to non-NULL values; convert data types to string types.
Usage of plus sign ( ) operator in Oracle
The plus sign ( ) operator in Oracle has many Uses include:
1. Connecting strings
<code class="sql">SELECT 'Hello' || ' World'; -- 输出:HelloWorld</code>
2. Connecting numbers
<code class="sql">SELECT 12 + 34; -- 输出:46</code>
3 . Connection date
<code class="sql">SELECT DATE '2023-01-01' + INTERVAL '1' DAY; -- 输出:2023-01-02</code>
4. Connection time interval
<code class="sql">SELECT INTERVAL '1' HOUR + INTERVAL '30' MINUTE; -- 输出:INTERVAL '1:30' HOUR TO MINUTE</code>
5. NULL processing
plus sign( ) operator can convert NULL values to non-NULL values, as follows:
<code class="sql">SELECT NULL + 'Hello'; -- 输出:Hello SELECT NULL + 12; -- 输出:12</code>
6. Convert data type
The plus sign ( ) operator can implicitly convert the data type to a string type.
<code class="sql">SELECT '12' + 34; -- 输出:'1234'</code>
Note:
The above is the detailed content of Usage of (+ in oracle. For more information, please follow other related articles on the PHP Chinese website!