node ninja
node ninja

Reputation: 32986

sqlite tables don't need column names?

In sqlite I was able to create a table with the following command:

create table myTable(varchar, date, int);

Notice that there are no column names! I discovered this when I used column names, and when I executed a where statement, it didn't work with the column name, but it worked when I specified the variable type instead. What's up with that?

Upvotes: 1

Views: 118

Answers (1)

newtover
newtover

Reputation: 32094

But they became names instead of datatypes:

sqlite> create table myTable(varchar, date, int);
sqlite> .headers on
sqlite> insert into myTable Values(1,1,1);
sqlite> select * from myTable;
varchar|date|int
1|1|1

Upvotes: 2

Related Questions