user3081519
user3081519

Reputation: 2869

SQLite: No Column Names In Output of Select Statement

I am new to SQLite and trying to work my way through the basics. The problem is when I give it a simple command:

select * from newTable;

The output is as follows:

GoodState|GoodCapital
ShittyState|Raleigh

Which does not provide the column names on the output. My column names are: State and State_Capital

Is there any option available to make the column names show up on the top of the columns outputted like in MySql?

Upvotes: 5

Views: 1811

Answers (2)

Max MacLeod
Max MacLeod

Reputation: 26682

Please, if I may be allowed to supplement the answer with the command-line alternative:

sqlite3 -noheader foo.db "select * from newTable"

Upvotes: 0

user3081519
user3081519

Reputation: 2869

Oh. My bad. I should've googled more thoroughly.

The answer is:

.headers on 

This enabled column headers in output.

Upvotes: 4

Related Questions