> On Aug 17, 2015, at 12:01 PM, Clemens Ladisch <clemens at ladisch.de> wrote: > > Just because the ORDER BY clause refers to a column of the > SELECT clause does not mean that the value is not computed > a second time.
And yet: with DataSet( position, value ) as ( select 1 as position, random() as value union all select DataSet.position + 1 as position, random() as value from DataSet where DataSet.position < 10 ) select DataSet.value from DataSet order by DataSet.value; -4870943077918547304 -4477154295778822007 -3065995363549703972 -2365142629623062778 -1659827499818666566 -422422602260941678 122478153305412750 2673926196199910076 2741194622440706627 4802559261241955862