---
title: "Oracle Group By 默认排序文件"
author: "vvnet"
date: "2013-11-19T16:00:57Z"
tags: []
categories: ["数据库"]
slug: "oracle-group-by"
draft: false
lastmod: "2013-11-19T16:02:19Z"
id: 1976973
url: "https://vvnet.iteye.com/blog/1976973"
---

**问题描述：**

oracle 9i 下的Group By 后面不加order by ,以前都有默认排序的,现在换成11g后就没有排序了

**分析：**

9i没有hash group by，10g才有\_gby\_hash\_aggregation\_enabled 是隐含参数

普通show parameter查不到的

**方法：**

1、在SYS用户下执行SQL：

 select ksppinm NAME, ksppstvl VALUE

      from x$ksppi pi, x$ksppcv cv

     where cv.indx = pi.indx

       and pi.ksppinm like '%\_gby\_hash\_aggregation\_enabled%';

NAME

\--------------------------------------------------

VALUE

\--------------------------------------------------

\_gby\_hash\_aggregation\_enabled

TRUE

2、修改参数：

ALTER SYSTEM SET "\_gby\_hash\_aggregation\_enabled" = FALSE;