SQLite选择两列作为Null

时间:2012-04-03 12:44:33

标签: sql sqlite

如果其中一列中有Null,我如何组合这两列?

SELECT (column1 || " " || column2) AS expr1 FROM your_table;

我希望输出为:

enter image description here

1 个答案:

答案 0 :(得分:4)

SELECT (COALESCE(column1,'') || " " || COALESCE(column2, '')) AS expr1 FROM your_table;