Search code examples
mysqldbforge

How do I get conditional output in a report?


I have a table that with a cell that may contain one of several defined words (such as "piping" or "containment"). I want to display a phrase specific to the word based on the word in my table. So if the table says piping, want the section of my report to say "...the piping in this area..." a null value would return specific text as well.


Solution

  • What about a CASE statement? Something like this:

    CASE {column}
        WHEN 'Piping' THEN 'Piping in this area'
        WHEN 'Containment' THEN 'Etc....'
    END AS "Project status?"