title: sql if null show 0
body: <p>In SQL how do you show 0 if record is null?</p>
  
  <pre><code>select sales_id, totalbuy, totalsell, totalbuy + totalsell as total from
  (select sales_id, SUM(CASE WHEN side= 'buy' THEN 1 ELSE 0 END) AS totalbuy, 
  SUM(CASE WHEN side= 'sell' THEN 1 ELSE 0 END) AS totalsell 
  from car_orders 
  where sales_id in ('sales1', 'sales2', 'sales3', 'sales4')only
  GROUP BY sales_id)q
  order by total desc
  limit 0, 10;
  </code></pre>
  
  <p>After <code>car_orders</code> I have tried inserting*(car_orders+ISNULL(car_orders,0)) but get an error.</p>