Search notes:

ORA-30485: missing ORDER BY expression in the window specification

Some analytic functions require an ORDER BY expression. Without such an expression, the ORA-30485: missing ORDER BY expression in the window specification is thrown, as for example in the following SQL statement:
select
       object_type                                     typ,
       object_name                                     obj,
   lag(object_name, 1) over (partition by object_type) obj_lag
from
   user_objects
order by
   object_name
;
The following statement has such on order by clause and doesn't throw this error:
select
       object_type                                     typ,
       object_name                                     obj,
   lag(object_name, 1) over (partition by object_type
                             ORDER     BY object_name) obj_lag
from
   user_objects
;

See also

Analytic functions
Other Oracle error messages

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1759612305, '216.73.216.149', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/errors/ORA-30485_missing-ORDER-BY-expression-in-the-window-specification(59): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78