Re: testing if value is null

On Mar 31, 10:12 am, laredotornado <laredotorn... [at] zipmail.com> wrote:
> How do I write a query where if a column, "value," is NULL I return
> the phrase "No value entered" but otherwise return the column's value,
> even if it is the empty string? I'm tried to modify this simple query

You can also use a case statement.

select column1, column2,
value = case when value is null then 'No Value Entered' else value
end,
column4
from meta_data
christopher.secord [ Mo, 31 März 2008 20:47 ] [ ID #1931544 ]
Datenbanken » comp.databases.ms-sqlserver » Re: testing if value is null

Vorheriges Thema: Re: Doing Summation on multiple criterias on the same column in a
Nächstes Thema: Re: Doing Summation on multiple criterias on the same column in a