Can I concat two or more columns in Android sqlite ?
eg select columna++ columnb as columnc from table
1 Answer
Try select columna || columnb as columnc from table.
2 Comments
czesław
ERROR/AndroidRuntime(264): Caused by: java.lang.IllegalArgumentException: column 'TITLE || BEGIN as BLABLA' does not exist
Femi
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).