Re:Amazon’s Consumer Business Turned Off Final Oracle Database
by koolba on Tuesday October 15, 2019 @01:46PM
(#21261394)
> any functions in the order by clause must be moved to the select statement (e.g. order by lower(column_name))
What does this refer to? AFAIK, you can invoke functions just about anywhere including in the ORDER BY clause:
=> CREATE FUNCTION some_func (int) RETURNS int AS $$ SELECT $1 + 1; $$ LANGUAGE SQL;
CREATE FUNCTION
=> SELECT t.* FROM (SELECT 1 AS a) t ORDER BY some_func(t.a);
a
---
1
(1 row)
Are you referring to not being able to reference column aliases in an ORDER BY clause? (work around is to use a subquery)
=> SELECT 1 AS a ORDER BY some_func(a);
ERROR: column "a" does not exist
LINE 1: SELECT 1 AS a ORDER BY some_func(a);
What does this refer to? AFAIK, you can invoke functions just about anywhere including in the ORDER BY clause:
Are you referring to not being able to reference column aliases in an ORDER BY clause? (work around is to use a subquery)