On second thought what I wanted to do should work, I think. I'm not clear why
the first of these works fine but the second doesn't. What I want to do is
effectively the second of these:
slo=> select (select count(*) from t2) as x from t order by x;
x
---
0
(1 row)
slo=> select (select count(*) from t2) as x from t order by sign(x);
ERROR: Attribute "x" not found
--
greg