Thursday 14 August 2014

Inline switch case in SQL

CASE ISNULL(upub.SharedBy,0) //ISNULL -if value is null then convert to 0.
       WHEN 0  // true when upub.SharedBy=0
            THEN pub.PublicationDate
            ELSE  upub.DateUpdated
 END

No comments:

Post a Comment