Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
219 views
in Technique[技术] by (71.8m points)

SQLite problem selecting two columns as one

Basic table with empname and empdpt.
In a Sql Server table, I can do Select empname + ' ' + empdpt as expr1 no problem.
Can't do the same using Sqlite!!
When I try to combine two columns [with data], I get back a 0.
I've tried in sqliteman and sqliteadmin as well as Server Explorer in VS.

question from:https://stackoverflow.com/questions/1003358/sqlite-problem-selecting-two-columns-as-one

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Try using the following:

SELECT ("test" || " " || "test2") AS expr1 ;

Update

If these are columns you can do something similar: SELECT (column1 || " " || column2) AS expr1 FROM your_table;


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...