SQLite Forum

How to select columns that have name beginning with same prefix?
Login
You can do this in the CLI using .once and .read

.once /tmp/aaa.sql
select 'select ' || group_concat(name) || ' from mytable' from pragma_table_info('mytable') where substr(name,1,7)='PREFIX_';
.read /tmp/aaa.sql