[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 254
  • Last Modified:

replacing number

If I have the following result of crosstab query
      Product 1      Product 2       Product 3      Product4
Customer 1            5.5            666
Customer 2      .222            454      
Customer 3      258      252            365
Customer 4                        
Customer 5      25            25      

Based on this result I would like to run another query that will leave the null value but replace the  numbers with “1”
0
dina78
Asked:
dina78
1 Solution
 
Pratima PharandeCommented:
use isnull(colname,1)

0
 
enachemcCommented:
select product1, case
when product2 is not null then 1
else null
end product2
from (
--your old query
)
0
 
awking00Commented:
What dbms are you using?
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now