THE SQL Server Blog Spot on the Web

Welcome to SQLblog.com - The SQL Server blog spot on the web Sign in | |
in Search

Browse by Tags

All Tags » SQL Server 2005 » trick » sqL Server 2000   (RSS)
  • Return Null If A Value Is A Certain Value

    You need to return NULL only if the value of your data is a certain value. How do you do this? There are three different ways. NULLIFDECLARE @1 char(1)SELECT @1 ='D' SELECT NULLIF(@1,'D')REPLACEThis should not really be used, I just added it here to demonstrate that you can in fact use it.DECLARE @1 char(1)SELECT @1 ='D' SELECT ...
    Posted to Denis Gobo (Weblog) by Denis Gobo on November 6, 2007
Powered by Community Server (Commercial Edition), by Telligent Systems
  Privacy Statement