select field1, field2, Field3,
case when exists
(select field1
from tbl1
where field < 0) then 0 else field1 end as Field2
from tbl1
Sql – set negative numbers in a view to zero and any positive should remain the same
casesql
casesql
select field1, field2, Field3,
case when exists
(select field1
from tbl1
where field < 0) then 0 else field1 end as Field2
from tbl1
Best Solution
Assuming its T-SQL, its similar to a question from earlier but here goes: