Can I concat two or more columns in Android sqlite ?
eg select columna++ columnb as columnc from table
Asked
Active
Viewed 6,329 times
1 Answers
16
Try select columna || columnb as columnc from table.
Femi
- 63,688
- 8
- 117
- 146
-
ERROR/AndroidRuntime(264): Caused by: java.lang.IllegalArgumentException: column 'TITLE || BEGIN as BLABLA' does not exist – czesław May 09 '11 at 11:51
-
Not sure why you are having problems: `Cursor mCursor = mDb.rawQuery("SELECT *, \""+ KEY_NAME + "\" || \""+KEY_DESC + "\" AS val FROM "+DATABASE_TABLE_LOGS + " ORDER BY " + order, null);` works for me. I can extract the `val` column from the resulting cursor. You might need to escape the columns as I did above (using double quotes). – Femi May 09 '11 at 14:23