Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
集合関数で ORDER BY を使用できるのは、SELECT リストに DISTINCT 集合関数がないか、ORDER BY の最初のカラムと等しい DISTINCT カラムのある DISTINCT 集合関数が 1 つある場合だけです。また、ORDER BY 句が完全に同じでないかぎり、並べ替えた複数の集合関数を同じ SELECT リストの中で使用することはできません。