DuckDB dynamic column selection gets even better
Learn Data with Mark Learn Data with Mark
10.1K subscribers
307 views
43

 Published On Sep 22, 2024

In this video, we're going to learn about dynamic column selection in DuckDB using the COLUMNS clause. It's been possible to do this for quite some time, but the recent release of DuckDB 1.1 made this functionality even more useful.

We'll start off with an introduction to the COLUMNS clause, showing how to return columns based on a regular expression. We'll then see how to exclude the columns returned by using the lambda functionality of the COLUMNS clause, combined with a list of field names stored in a variable.

We'll see how to only return columns of a specific data type, again with help from the variables feature. We'll also see how you can filter the results of a query where the value in every column must be greater than a certain value.

Finally we'll learn how to use the new splat operator that lets us find the maximum value in any of the columns for a given row.

🟡 Blog - https://www.markhneedham.com/blog/202...
🟡 Columns clause - https://duckdb.org/docs/sql/query_syn...
🟡 DuckDB 1.1 release - https://duckdb.org/2024/09/09/announc...
🟡 Kaggle FIFA dataset - https://www.kaggle.com/datasets/stefa...

show more

Share/Embed