我正在尝试使用一个 SELECT 语句选择多个列,但我尝试过这样但没有奏效。
mysql> SELECT AVG(salaryoffered) "$ offer" AS "Average Salary", MIN(salaryoffered)
"$ offer" AS "Min Salary", MAX(salaryoffered) "$ offer" AS "Max Salary" FROM
interview;
但是,他们确实工作并单独使用 SELECT 调出表格。像这样:
mysql> SELECT AVG(salaryoffered) "$ offer" AS "Average Salary"
mysql> SELECT MIN(salaryoffered) "$ offer" AS "Min Salary"
mysql> SELECT MAX(salaryoffered) "$ offer" AS "Max Salary"
-> FROM interview;
知道如何将三个表放在一个命令中吗?假设看起来像这样:
+----------------+------------+------------+
| Average Salary | Min Salary | Max Salary |
+----------------+------------+------------+
| 12.080357 | 10.75 | 13.75 |
+----------------+------------+------------+