SQLite Forum

select * from t; -- but don't want virtual columns
Login
Note that you can do something like the following to create the appropriate view and do it entirely in SQL (requires the eval extension):

```
SQLite version 3.34.0 2020-09-11 22:07:03
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> create table x (x, y as (x+1), z, z1 as (z+1) stored);
sqlite> select 'create view main.vw_x as select ' || (select group_concat(name, ', ') from pragma_table_xinfo where arg='x' and schema='main' and hidden=0 order by cid) || ' from main.x';
┌─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ 'create view main.vw_x as select ' || (select group_concat(name, ', ') from pragma_table_xinfo where arg='x' and schema='main' and hidden=0 order by cid) || ' from main.x' │
├─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│ create view main.vw_x as select x, z from main.x                                                                                                                            │
└─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
sqlite> select eval((select 'create view main.vw_x as select ' || (select group_concat(name, ', ') from pragma_table_xinfo where arg='x' and schema='main' and hidden=0 order by cid) || ' from main.x'));
┌────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┐
│ eval((select 'create view main.vw_x as select ' || (select group_concat(name, ', ') from pragma_table_xinfo where arg='x' and schema='main' and hidden=0 order by cid) || ' from main.x')) │
├────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┤
│                                                                                                                                                                                            │
└────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
sqlite> .schema main.*
CREATE TABLE x (x, y as (x+1), z, z1 as (z+1) stored);
CREATE VIEW vw_x as select x, z from main.x
/* vw_x(x,z) */;
```