v.19.13New Feature

Allow to Specify a List of Columns with Columns('regexp') Expression That Works Like a More Sophisticated Variant of * Asterisk

Allow to specify a list of columns with COLUMNS('regexp') expression that works like a more sophisticated variant of * asterisk. #5951 (mfridental), (alexey-milovidov)
Introduces the COLUMNS('regexp') expression to specify a list of columns matching a regular expression, offering a more flexible alternative to the * asterisk for column selection.

Why it matters

This feature allows users to select multiple columns based on pattern matching using regular expressions, simplifying queries where columns follow naming conventions and avoiding the need to explicitly list each column. It enhances query expressiveness and maintainability.

How to use it

Use the COLUMNS('regexp') function in your SELECT statements where you want to match columns by a regular expression pattern. For example:

SELECT COLUMNS('^prefix_') FROM table_name

This will select all columns starting with the prefix "prefix_".