Replies: 4 comments 1 reply
-
Eagerly waiting for the solution to this |
Beta Was this translation helpful? Give feedback.
0 replies
-
What about a lambda function as a second parameter in COLUMNS()?
|
Beta Was this translation helpful? Give feedback.
0 replies
-
I've opened a PR with improvements to the naming of D select columns(*)::VARCHAR FROM (select 42 a, 84 b);
┌─────────┬─────────┐
│ a │ b │
│ varchar │ varchar │
├─────────┼─────────┤
│ 42 │ 84 │
└─────────┴─────────┘
D select MIN(COLUMNS(*)) AS "min_\0" FROM (select 42 a, 84 b);
┌───────┬───────┐
│ min_a │ min_b │
│ int32 │ int32 │
├───────┼───────┤
│ 42 │ 84 │
└───────┴───────┘ |
Beta Was this translation helpful? Give feedback.
1 reply
-
This is now available via regex syntax, e.g., |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I find myself frequently writing COLUMNS expressions using regex to select a multitude of columns (100+). https://duckdb.org/docs/sql/expressions/star#columns
This works great. However, once you need to to further processing AFTER the selection, e.g., in a following CTE, it becomes cumbersome, as you cannot specify the column names anymore.
Example:
This will result in a table that looks like this:
Does anyone know of a way to preserve the original column name, or re-set the alias to the original column name?
Beta Was this translation helpful? Give feedback.
All reactions