急急急啊。请问这个distinct和order by什么地方出错了~??? 是distinct还是order by的问题,还是什么问题 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 SQL> select distinct empno from emp order by deptno ; select distinct empno from emp order by deptno ORA-01791: not a SELECTed expression select distinct empno from emp order by emp; select distinct * from emp order by deptno select distinct empno from emp order by empno;打错字了 select empno from emp group by empno order by max(deptno) 如果指定了 SELECT DISTINCT,那么 ORDER BY 子句中的项就必须出现在选择列表中。 select distinct deptno,empno from emp order by deptno;可以这样! 老打错!select distinct deptno,empno from emp order by deptno,empno; DISTINCT的步骤中包含聚合和排序,ORDER BY的执行顺序是在聚合后,所以未聚合的列作为排序时会报错。 请教:将当前数据库中所有表名以'E'开头的数据表上的名字为‘AAA'的索引删除 2张表之间的转换 请教:exec()用法 请教一个简单的Sql语句? 怎样取最大编号加1显示出来? 服务器架设问题,求高人指点。自己摸索2天了 sql 2005 SP2 补丁是怎么安装的?? 有没有本月次周的计算函数? 我在用substring中的问题 怎么知道安装后的数据库的名字是什么? 100求解。sql server 2005和visual studio 2010能兼容使用吗? SQL Server 2008 R2 和SQL Server 2008的区别?
select distinct empno from emp order by deptno
ORA-01791: not a SELECTed expression
如果指定了 SELECT DISTINCT,那么 ORDER BY 子句中的项就必须出现在选择列表中。
老打错!select distinct deptno,empno from emp order by deptno,empno;