Highlighted

Regex again in SQL

jael91407431

06-11-2017

Hi,

In MySQl, we have the ability to query using regex expressions, like:

mysql > SELECT name, name LIKE '%ns' ends_in_ns
-> FROM department;

...which yields:

ends.png

This example retrieves all the department names (fields) that name ends in “ns” as in "Operations," "Loans."

My question is, can we also include regex expressions as part of the value (SQL equivalent of "LIKE" or "INCLUDES," etc. plus regex (for example, "j%n.com" to include all email addresses starting with "j" and ending in "n") to query in the Query activity?

Replies