![]() ![]() Furthermore searched case works in virtually all SQL databases. The other variants are abbreviations that could also be written as searched case. The following example shows the syntax in the most generic form-the so-called searched case. The syntax of the case expression is very flexible and allows for some abbreviations. Its use is similar to the ternary operator ?: in other programming languages. Being an expression-rather than a control structure-means that case varies the result of formulas (expressions) based on conditions. Nevertheless, SQL has something similar: the case expression. SQL is a declarative language: it does not provide control over program flow like if does for imperative programs. ![]()
0 Comments
Leave a Reply. |