title: Issue with NULL values in creating a view in sql table
body: <p>I am working on a SQL View over a table with different values in it. I am trying to combine two columns in a table to be displayed in a single column of a view separated by a '/'. </p>
  
  <p>For Example I have two columns in a table named <code>In</code> and <code>inVolume</code> with values for 'In' being
   <code>1,2,NULL</code> </p>
  
  <p>and for 'inVolume ' being </p>
  
  <p><code>NULL, 100, 200</code> </p>
  
  <p>and the results I was expecting are  <code>1/(NULL or Empty)</code>,  <code>2/100, (NULL or Empty)/200</code> but when I created the view and ran it the results were <em><code>(NULL or Empty), 2/100, (NULL or Empty)</code></em>. The issue being it is making the column in view as NULL if any of the columns In or inVolume in the table are NULL.</p>
  
  <p>I created the following view </p>
  
  <p><strong>SQL View</strong> </p>
  
  <pre><code>CREATE VIEW [dbo].[Result]
  AS
  
  with CTE as(
  SELECT distinct
     CC.Product,
     CC.Term,   
     CC.TermID,
     iCC.In,
     iCC.Out,
     iCC.inVolume,
     iCC.outVolume
  
     FROM Cust CC
  CROSS APPLY (SELECT TOP 3
                  In,
                  Out, 
                 inVolume,
                  outVolume
  
               FROM Cust iCC
               WHERE CC.Term = iCC.Term and CC.Product = iCC.Product
               ORDER BY iCC.In DESC, iCC.Out ASC) iCC)
               select Product, Term, cast(inVolume as varchar(99)) + '/' + cast(In as varchar(99)) as value, inlabel as label from CTE 
               union
               select Product, Term, cast(Out as varchar(99)) + '/' + cast(outVolume as varchar(99)), outlabel from CTE 
  
  GO
  </code></pre>
  
  <p>Any better way to deal with this?</p>