Replacing NULL with 0 in a SQL server query

后端 未结 12 1243
情书的邮戳
情书的邮戳 2020-11-28 02:39

I have developed a query, and in the results for the first three columns I get NULL. How can I replace it with 0?

  Select c.rund         


        
12条回答
  •  广开言路
    2020-11-28 03:05

    If you are using Presto, AWS Athena etc, there is no ISNULL() function. Instead, use:

    SELECT COALESCE(myColumn, 0 ) FROM myTable
    

提交回复
热议问题