• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 256
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

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