[Solved] How to write attribute name on two lines in a SQL Query


When naming a column in a simple SELECT statement like so:

SELECT stuff FROM someTable

Which will print out like so:

—-stuff—-

— foo

— bar

You can name the column stuff to whatever you like by using single quotations and the AS alias identifier,
like so:

SELECT stuff AS 'Stuff Column' FROM someTable

This will print out like:

—-Stuff Column—-

— foo

— bar

To place the name on two lines you can try a pipe: | this will work with some IDE‘s like so:

SELECT stuff AS 'Stuff|Column' FROM someTable

Query would look like this:

—-Stuff

—-Column

— foo

— bar

Read more on using aliases here or formatting columns here

solved How to write attribute name on two lines in a SQL Query