(jlive)[crashcourse]>SELECT Concat(RTrim(vend_name), ' (', RTrim(vend_country), ')') AS vend_title FROM vendors ORDER BY vend_title;
+-------------------------+
| vend_title
+-------------------------+
| ACME (USA)
| Anvils R Us (USA)
| Furball Inc. (USA)
| Jet Set (England)
| Jouets Et Ours (France) |
| LT Supplies (USA)
+-------------------------+
6 rows in set (0.01 sec)
数学计算
MariaDB Mathematical Operators
--------------------------------
Operator Description
--------------------------------
+ Addition
- Subtraction
* Multiplication
/ Division
--------------------------------
(jlive)[crashcourse]>SELECT prod_id, LTrim(quantity), LTrim(item_price), LTrim(quantity*item_price) AS expanded_price FROM orderitems WHERE order_num = 20005;
+---------+-----------------+-------------------+----------------+
| prod_id | LTrim(quantity) | LTrim(item_price) | expanded_price |
+---------+-----------------+-------------------+----------------+
| ANV01
| ANV02
| TNT2
| FB
+---------+-----------------+-------------------+----------------+
4 rows in set (0.01 sec)