Function Argument Modifier

Q

What Is Function Argument Modifier?

✍: FYIcenter.com

A

Function argument modifier is an expression placed before or after a function argument to modify the behavior of the function. For example:

SET @str = 'Yahooo';

SELECT TRIM(TRAILING 'o' FROM @str);
  -- +------------------------------+
  -- | TRIM(TRAILING 'o' FROM @str) |
  -- +------------------------------+
  -- | Yah                          |
  -- +------------------------------+

Sometimes argument modifiers are used to make the function call more readable. For example:

SET @str = 'Yahooo';

SELECT POSITION('o' IN @str), LOCATE('o', @str);
  -- +-----------------------+-------------------+
  -- | POSITION('o' IN @str) | LOCATE('o', @str) |
  -- +-----------------------+-------------------+
  -- |                     4 |                 4 |
  -- +-----------------------+-------------------+

 

Variable Number of Arguments

Function Name Case Insensitive

Calling MySQL Built-in Functions

⇑⇑ MySQL Function References

2023-11-14, 257🔥, 0💬