extract_url_parameter

description

Syntax

VARCHAR extract_url_parameter(VARCHAR url, VARCHAR name)

Returns the value of the “name” parameter in the URL, if present. Otherwise an empty string. If there are many parameters with this name, the first occurrence is returned. This function works assuming that the parameter name is encoded in the URL exactly as it was in the passed parameter.

  1. mysql> SELECT extract_url_parameter ("http://doris.apache.org?k1=aa&k2=bb&test=cc#999", "k2");
  2. +--------------------------------------------------------------------------------+
  3. | extract_url_parameter('http://doris.apache.org?k1=aa&k2=bb&test=cc#999', 'k2') |
  4. +--------------------------------------------------------------------------------+
  5. | bb |
  6. +--------------------------------------------------------------------------------+

keywords

  1. EXTRACT URL PARAMETER