Re: [sqlite] Is there a way to select using cid?

2019-03-25 Thread Eduardo Morras
On Sat, 23 Mar 2019 12:57:55 +0100 (CET) Eric wrote: > On Fri, 22 Mar 2019 16:34:20 -0500, Peng Yu > wrote: > > There are cid's for each table. Is there a way to use "select" with > > cid's instead of their names? Thanks. > > > > $ sqlite3 dbfile < > create table test (id integer primary key, v

Re: [sqlite] Is there a way to select using cid?

2019-03-23 Thread Eric
On Fri, 22 Mar 2019 16:34:20 -0500, Peng Yu wrote: > There are cid's for each table. Is there a way to use "select" with > cid's instead of their names? Thanks. > > $ sqlite3 dbfile < create table test (id integer primary key, value text); > insert into test (id, value) values (1, 'abc'); > .mode

Re: [sqlite] Is there a way to select using cid?

2019-03-23 Thread Clemens Ladisch
Peng Yu wrote: > There are cid's for each table. Is there a way to use "select" with > cid's instead of their names? > > select * from pragma_table_info('test'); > cid nametypenotnull dflt_value pk > -- -- -- -- -- --

Re: [sqlite] Is there a way to select using cid?

2019-03-22 Thread Simon Slavin
On 22 Mar 2019, at 9:34pm, Peng Yu wrote: > There are cid's for each table. Is there a way to use "select" with > cid's instead of their names? In recent versions of SQLite you can use the result from pragma_table_info('test') as if it is a table. So you can do SELECT select * from pragma_tab

[sqlite] Is there a way to select using cid?

2019-03-22 Thread Peng Yu
There are cid's for each table. Is there a way to use "select" with cid's instead of their names? Thanks. $ sqlite3 dbfile