mysql中某列前面的'-'是什么意思?
What is '-' in front of a column in mysql mean?
下面代码中的“-”(代码最后一行,a.emp_no之前)是什么意思?我一直在努力理解,但我想要确定的答案。请帮助!!!!!!!!!!!!!!!!!!!!
SELECT *
FROM
(SELECT
e.emp_no,
e.first_name,
e.last_name,
NULL AS dept_no,
NULL AS from_date
FROM
employees.employees e
WHERE
last_name = 'Denis'
UNION SELECT
NULL AS emp_no,
NULL AS first_name,
NULL AS last_name,
dm.dept_no,
dm.from_date
FROM
employees.dept_manager dm) as a
ORDER BY -a.emp_no DESC;
如果 emp_no 是一个数字 - 那么它要求按数字的负数排序。你也可以说
order by a.emp_no
下面代码中的“-”(代码最后一行,a.emp_no之前)是什么意思?我一直在努力理解,但我想要确定的答案。请帮助!!!!!!!!!!!!!!!!!!!!
SELECT *
FROM
(SELECT
e.emp_no,
e.first_name,
e.last_name,
NULL AS dept_no,
NULL AS from_date
FROM
employees.employees e
WHERE
last_name = 'Denis'
UNION SELECT
NULL AS emp_no,
NULL AS first_name,
NULL AS last_name,
dm.dept_no,
dm.from_date
FROM
employees.dept_manager dm) as a
ORDER BY -a.emp_no DESC;
如果 emp_no 是一个数字 - 那么它要求按数字的负数排序。你也可以说
order by a.emp_no