sequence [message #19387] |
Wed, 13 March 2002 23:03 |
THA
Messages: 26 Registered: February 2002
|
Junior Member |
|
|
hello
Will any one help me? the following query works with an effect as given by rownum.
SELECT seq.NEXTVAL,empno,ename,deptno
FROM emp;
but
SELECT seq.NEXTVAL,empno,ename,deptno
FROM emp
ORDER BY deptno;
gives " sequence number not alowed here". What is the reason?
Thanks
|
|
|
Re: sequence [message #19394 is a reply to message #19387] |
Thu, 14 March 2002 04:30 |
pratap kumar tripathy
Messages: 660 Registered: January 2002
|
Senior Member |
|
|
You cannot use CURRVAL and NEXTVAL:
****A subquery in a DELETE, SELECT, or UPDATE statement
****A query of a view or of a materialized view
****A SELECT statement with the DISTINCT operator
****A SELECT statement with a GROUP BY clause or ORDER BY clause
****A SELECT statement that is combined with another SELECT statement with the UNION, INTERSECT, or MINUS set operator
|
|
|