如何以特定格式显示查询结果

时间:2022-10-18 22:58:35

I have two columns named FirstName and LastName. I want to query these from the table and display them in the format "FirstName LastName" (Note there is a space between FirstName and LastName) under the same column.

我有两列名为FirstName和LastName。我想从表中查询这些并在同一列下以“FirstName LastName”格式显示它们(注意FirstName和LastName之间有一个空格)。

Edit 1

I tried this

我试过这个

如何以特定格式显示查询结果

and the result comes like this

结果是这样的

如何以特定格式显示查询结果

Why am I getting 0's ?

我为什么得到0?

3 个解决方案

#1


2  

The string concatenation operator in SQLite appears to be ||. So (assuming that the columns are both NOT NULL-able)

SQLite中的字符串连接运算符似乎是||。所以(假设列都是NOT NULL)

SELECT FirstName || ' ' || LastName FROM Users

#2


0  

SELECT FirstName + ' ' + LastName FROM Users

#3


0  

select FirstName + ' ' + LastName as FullName
from SomeTable

#1


2  

The string concatenation operator in SQLite appears to be ||. So (assuming that the columns are both NOT NULL-able)

SQLite中的字符串连接运算符似乎是||。所以(假设列都是NOT NULL)

SELECT FirstName || ' ' || LastName FROM Users

#2


0  

SELECT FirstName + ' ' + LastName FROM Users

#3


0  

select FirstName + ' ' + LastName as FullName
from SomeTable