All,
I need an SQL statement to determine if two fields have the same sign.
There's the obvious..
select
case
when Fld1 <= 0 and Fld2 <= 0 then 'Yes'
when Fld1 >= 0 and Fld2 >= 0 then 'Yes'
else 'No'
end as Same_Sign
from myFile
And the slightly tricky (Though I haven't quite convinced myself
that it'd work :)
select
case
when abs(fld1) + abs(fld2) = abs(fld1 + fld2) then 'Yes'
else 'No'
end as Same_Sign
from myFile
Anybody have any thoughts on either one of the above methods or an
alternative method?
The statement in question will be dealing with a couple of 80M record files.
Thanks!
Charles Wilt