List:General Discussion« Previous MessageNext Message »
From:Rhino Date:January 6 2006 1:44pm
Subject:Fw: SQL Question
View as plain text  
Oops, I meant to send this to the list.

Rhino

----- Original Message ----- 
From: "Rhino" <rhino1@stripped>
To: "Mester József" <mesterjoco@stripped>
Sent: Friday, January 06, 2006 8:44 AM
Subject: Re: SQL Question


>
> ----- Original Message ----- 
> From: "Mester József" <mesterjoco@stripped>
> To: "Mysql list" <mysql@stripped>
> Sent: Friday, January 06, 2006 3:42 AM
> Subject: SQL Question
>
>
>> Hy
>>
>>  I want to sum quantites but there is some data that value is negative 
>> but users didn't write the - sign before. I can decide which datas are 
>> negative.
>>
>>  I would like something like that
>>
>>  select sum(moved_quantities) from db
>>  if moving like 'Move-' then sum seem the move is negative
>>  else move value is positive
>>
>>  Is it possible?
>>
> If you know which values are supposed to be negative, wouldn't it be 
> easier to do updates to your data to change all of those values to 
> negatives? That should only need to be done once. Then use the normal SQL 
> sum() function to add all of the values together.
>
> Rhino 



-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.371 / Virus Database: 267.14.14/222 - Release Date: 05/01/2006

Thread
Fw: SQL QuestionRhino6 Jan