Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • SQL query to add column's values, containing null values

    • 0
    • 1
    • 1
    • 1
    • 0
    • 0
    • 1
    • 0
    • 231
    Comment on it

    Write a sql query to add column's value , containing null values also in records. But the sum of the added columns must be numeric only. Output cannot be null. It can be achieve by two ways.

    1. SELECT (COALESCE(Column1, 0) + COALESCE(Column2, 0)) as SUM FROM Table1
    2. SELECT ( ISNULL(Column1,0) + ISNULL(Column2,0) )as SUM FROM Table1
     SQL query to add  column's values, containing null values

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: