Database Administration Fundamentals (SF18SQL10001) – Day 3

So far, we have covered the two ways you can concatenate strings (using function `CONCAT()` or using the `+` sign). We understand that using the `+` sign has limitations. When adding a string to a NULL, your result is a NULL. To avoid the latter, we can use a `CASE` clause.

  CASE
    WHEN   condition1
      THEN action1
    WHEN   condition2
      THEN action2
    ELSE   escape_action
  END

Download the class notes for day 3.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.