Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1312
  • Last Modified:

Oracle NVL equivalent? Need to change nulls to a string at the Select line.

Hi,

    I'm looking for a SQL Server equivalent to the NVL oracle pl/SQL statement.  What it does is changes a value to another only if that value is null.  So if it's pulling 3 columns from a database, and the third column has the NVL on it, say with the second parameter "Empty" then any rows that have a null value in that column will return "Empty" for that column rather than a null.  Any ideas?

JP
0
gleznov
Asked:
gleznov
  • 2
1 Solution
 
rafranciscoCommented:
The equivalent of Oracle's NVL is ISNULL.

SELECT ISNULL(Price, 0)
0
 
rafranciscoCommented:
As an example:

SELECT Column1, ISNULL(Column3, Column2)
FROM YourTable
0
 
gleznovAuthor Commented:
Thanks!!

JP
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now