Oracle SQL 的 ORDER BY 子句支持以下几种排序方式:
示例:
SELECT * FROM employees
ORDER BY salary ASC;
示例:
SELECT * FROM employees
ORDER BY salary DESC;
示例:
SELECT * FROM employees
ORDER BY department_id, salary DESC;
示例:
SELECT * FROM employees
ORDER BY department_id NULLS FIRST, salary DESC;
示例:
SELECT * FROM employees
ORDER BY LENGTH(last_name) DESC;
示例:
SELECT * FROM employees
ORDER BY CASE WHEN salary > 5000 THEN 1 ELSE 0 END DESC, salary DESC;
这些是 Oracle SQL 中 ORDER BY 子句支持的常见排序方式。在实际应用中,可以根据需求选择合适的排序方式。