SQLite Forum

Colons in column names?
Login
Transcript:

```
[msa@dandy database]$ sqlite3 
SQLite version 3.31.1 2020-01-27 19:55:54
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> create table t1(id);
sqlite> create table t2(id, t1Id);
sqlite> insert into t1 values (0); insert into t2 values (1,0);
sqlite> .headers on
sqlite> select t1.id, t2.id from t1 join t2 on t1.id = t2.t1Id;
id|id
0|1
sqlite> select * from (select t1.id, t2.id from t1 join t2 on t1.id = t2.t1Id);
id|id:1
0|1
```

Can someone tell me why these two queries return different column names? And can I get SQLite to not do that? I'm using a SQLite framework that looks for table columns by their original schema name, and it's not finding the columns with the `:1` appended.

Cheers.