Michael Olivier <molivier@yahoo.com> wrote:
> I need a way to get abs value of a floating point number and
> (possibly separate function for) abs value of an integer in a select
> statement.
You had to look up the manuals at numerical *operators* -- no need to
define YAF ;-)
=> select @-17.0;
17
> Also how do I do squares and square roots? I saw some \|/ type
> notation for square root in an SQL book, but I didn't get postgres
> to take that.
try e.g.
=> select 2*2, 2^2;
4 4
and:
=> select |/2;
1.4142135623731
without the backslash (originally quoting in a shell?) it seems to
work ...
Hope it helps
Ulf
--
======================================================================
%%%%% Ulf Mehlig <umehlig@zmt.uni-bremen.de>
%%%%!%%% Projekt "MADAM" <umehlig@uni-bremen.de>
%%%% %!% %%%% ----------------------------------------------------
---| %%% MADAM: MAngrove | Center for Tropical Marine
||--%!% Dynamics | Biology
|| And | Fahrenheitstrasse 1
_ /||\_/\_ Management |
/ / \ \ ~~~~~~~~~~~~~~~~~ | 28359 Bremen/Germany
~~~~~~~~~~~~~~~~~~~~