On Thu, 27 Aug 1998, Chris Johnson wrote:
> I need to sort a list of entries by the absolute value of a particular
> field. I examined the documentation and found that @ is the operator that
> I need, but it doesn't appear to work on int2 or int4 fields.
>
> Anyone have any ideas on how to accomplish this?
guido=> select @a::float as abs from test order by abs;
abs
---
1
2
(2 rows)
I run 6.3.1 on Linux 2.0.27. BTW, trying to insert -2 into float
fields without casting didn't work on my box!
Regards, Guido
--------------------------------------------
Guido Carlo Piazzi gpiazzi@nemo.it
Non coronabitur nisi qui legitime certaverit