Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"AS" equivalent in sqlite

I'm a beginner with sqlite coming from mysql. maybe my question is dumb but I can't find the equivalent of the "AS" in mysql for example.

Example: "SELECT firstName || ' ' || lastName AS fullName FROM myTable;"

Is it possible?

Thanks in advance!

like image 785
dyesdyes Avatar asked Feb 27 '12 15:02

dyesdyes


1 Answers

SQLite also supports using AS, as shown in this diagram from the page Syntax Diagrams for SQLite:

result-column:

Syntax Diagrams For SQLite

Why do I want to use a "AS"?

Because it allows you to give a descriptive name to each column in your result set. You can use this name to refer to the column when you read the results.

like image 175
Mark Byers Avatar answered Sep 26 '22 20:09

Mark Byers