About 763,000 results
Open links in new tab
  1. sql - How to replace null values with a text? - Stack Overflow

    May 1, 2015 · Another alternative, quite simple and precise: Since, commision_pct is NUMBER data type, to_char will explicitly convert it into string. select Last_Name, decode (nvl (salary commission_pct,'0'),0,'No Commission',salary commission_pct) as COMM from employees; how about using IFF() last_name, .

  2. replace NULL with Blank value or Zero in sql server

    May 3, 2017 · Different ways to replace NULL in sql server. Replacing NULL value using: 1. ISNULL () function. 2. COALESCE () function. 3. CASE Statement.

  3. How to Replace NULL with Another Value in SQL Server – …

    May 30, 2018 · Therefore, if we want to retain the rows with null values, we can use ISNULL() to replace the null values with another value: SELECT STRING_AGG(ISNULL(TaskCode, 'N/A'), ', ') AS Result FROM Tasks; Result: Result ----- cat123, N/A, N/A, pnt456, rof789, N/A

  4. Replacing NULL and empty string within Select statement

    I have a column that can have either NULL or empty space (i.e. '') values. I would like to replace both of those values with a valid value like 'UNKNOWN'. The various solutions I have found suggest modifying the value within the table itself.

  5. How to replace NULL with Empty String in SQL Server?

    Oct 3, 2024 · There are two ways to replace NULL with blank values in SQL Server, function ISNULL (), and COALESCE (). Both functions replace the value you provide when the argument is NULL like ISNULL (column, '') will return empty String if the column value is NULL. Similarly, COALESCE (column, '') will also return blank if the column is NULL.

  6. SQL REPLACE Function Use and Examples - MSSQLTips.com - SQL

    Jan 24, 2022 · The REPLACE SQL function is used to replace a string or substring of a string with another string in a T-SQL script, SELECT statement, UPDATE statement, SQL query or stored procedure in a Microsoft SQL database.

  7. Replace Text in SQL Server Strings using REPLACE and TRANSLATE

    Apr 19, 2023 · REPLACE() and TRANSLATE() are both string functions and substitute characters for some others. TRANSLATE() only works on SQL Server 2017. You need to ensure your database compatibility is set to at least 140. With either REPLACE() or TRANSLATE(), if the string is NULL, the value returned is NULL. There is no difference in how either handle NULLs.

  8. Replace Nulls With Specified Values in SQL Server - C# Corner

    ISNULL() function, CASE statement, COALESCE() function can be used to replace null values in a SQL Server table. In this article we will see the various ways to replace null values in a table. C# Corner

  9. ISNULL in SQL Server (and other NULL functions) - Medium

    Feb 22, 2023 · The ISNULL function is used to replace NULL values with an empty string (‘’). If either column contains a NULL value, the FullName column will still be populated with the non-NULL value.

  10. Replacing NULL and Empty string in Select statement

    I don’t want 'null' to be displayed instead of null, I want to replace it with 'Super Boss'. We can utilize the ISNULL(), CASE statement, and COALESCE() functions. Let's examine practical examples of using each of them.

  11. Some results have been removed
Refresh