位置:首頁 > 數據庫 > SQL教學 > SQL算術運算符

SQL算術運算符

這裡是顯示SQL算術運算符的使用簡單的例子:

SQL> select 10+ 20;
+--------+
| 10+ 20 |
+--------+
|     30 |
+--------+
1 row in set (0.00 sec)

SQL> select 10 * 20;
+---------+
| 10 * 20 |
+---------+
|     200 |
+---------+
1 row in set (0.00 sec)

SQL> select 10 / 5;
+--------+
| 10 / 5 |
+--------+
| 2.0000 |
+--------+
1 row in set (0.03 sec)

SQL> select 12 %  5;
+---------+
| 12 %  5 |
+---------+
|       2 |
+---------+
1 row in set (0.00 sec)