Inspectopedia
 
2024.3

Using CASE instead of conditional function and vice versa

Warning
New
Last modified: 03 December 2024

Reports situations when CASE and IF are interchangeable.

Example (MySQL):

To keep your code short, you can replace the CASE structure with IF. You can do that by applying the Replace with 'IF' call intention action. The example code will look as follows:

To revert IF to CASE, click IF and apply the Replace with CASE expression intention action.