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.
views:
236answers:
2
+1
A:
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;
merkuro
2009-06-16 19:05:42
Select empname || " " || empdpt as expr1 works...thanks...Any idea why the basic a + b doesn't work in Sqlite?
2009-06-16 19:08:29
Nope, sorry. Don't know any reason and haven't found any answer for this on http://www.mail-archive.com/[email protected]/. However someone said that it is the same as in Oracle and PostgreSQL. Here are a couple other functions that might be interesting for you (Sqlite3):http://www.sqlite.org/lang_aggfunc.html
merkuro
2009-06-16 19:17:48
+2
A:
Select empname || " " || empdpt as expr1
the sqllite concat is the same as PostGreSQL ( || ) and not MYSQL or MSSQL 'CONCAT'
Spark
2009-06-16 19:06:51