abs()

----- Original Message ----- 
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, September 01, 2004 12:59 PM
Subject: A question of negative numbers..


Hi,
I have a query that returns a list of numbers ranging from -10 to +10

I would like to be able to have a 2nd column where a result of 5 is 5 but -5
is also 5, so in effect all the negative (and only the negative) results are
made positive to find the deviation from zero.

so
5, 4, -3, 4, -1, 0

would become
5, 4, 3, 4, 1, 0

I have been searching for if then else in google so I could do if a < 0 then
a = 0-a but no joy. is there a function to make negative numbers positive?


-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to