← Blog Home
By Brian Rue December 16th, 2014 changelog

RQL String Functions

RQL now includes a basic library of string functions. You can use these to slice and group your data in arbitrary ways. For example, "email domains with the most events in the past hour":

SELECT substring(person.email, locate('@', person.email)), count(*)
FROM item_occurrence
WHERE timestamp >= unix_timestamp() - 3600 AND person.email IS NOT NULL
GROUP BY 1
ORDER BY 2 DESC

The new functions: concat, concatws, lower, upper, left, right, substring, locate, length, charlength. The functions are implemented to be compatible with MySQL; see the RQL docs for details.

Join Our Community

Get the latest updates, tutorials and more, delivered to your inbox, once a month.

← Blog Home

Join Our Community

Get the latest updates, tutorials and more, delivered to your inbox, once a month.