How To Use Substring Function Sqlite Android
suppose I have a table name : TEST, that it has 2 columns ID and CONTENT, like this : TEST TABLE : ID ======= CONTENT 0 ======= hello world now, how can I split CONTENT column fr
Solution 1:
selectsubstr(content, 0, 5) from test
Solution 2:
The
substr(X,Y,Z)
function returns a substring of input string X that begins with the Y-th character and which is Z characters long. If Z is omitted thensubstr(X,Y)
returns all characters.
The answer to your question is:
selectsubstr(content, 0, 5) from test where id >= 0;
Solution 3:
Check substr()
function in sqlite3 core functions. It will let achieve what you need.
Use it as:
SELECT substr(content, 0, 5) FROM test WHERE id >=0;
Post a Comment for "How To Use Substring Function Sqlite Android"