SQL Logical Functions

Latest Posts

  • Can I have a CASE Statement in the WHERE Clause?
    ,

    ·

    Can I have a CASE Statement in the WHERE Clause?

    I’m commonly asked whether whether I can have a CASE Statement in the WHERE Clause. There are a number of examples using the CASE WHEN construct in SQL, such as the SELECT columns or in ORDER BY clauses, but we tend to forget CASE can be used wherever an expression is expected. Where Can I…

  • How to use the Choose Function with Select
    ,

    ·

    How to use the Choose Function with Select

    In this video we’ll walk you though how to use the CHOOSE function with SELECT. You’ll see how the function works and then a practical example using some sample data. Once you’ve gone through this article, I would recommend watching our next Essential SQL Minute to continue learn more about SQL Server! Once you have…

  • Introduction to SQL Server’s Built-In Logical Functions

    ·

    Introduction to SQL Server’s Built-In Logical Functions

    Logical functions provide a way to use logical conditions to display one of several values.  You can use logical functions to test a field’s value such as gender (M or F) and display another value(‘Male’ or ‘Female’) as a result.In this article we describe how to use the CHOOSE and IIF functions.  CHOOSE is really…

  • SQL CASE Statement – Simple and Searched Forms

    ·

    SQL CASE Statement – Simple and Searched Forms

    The main purpose of a SQL CASE expression returns a value based on one or more conditional tests.  Use CASE expressions anywhere in a SQL statement expression is allowed. Though truly an expression, some people refer to them as “CASE statements.”  This most likely stems from their use in programming languages. The SQL CASE expression…