android - How to order the result of SQLite query by input alphabet? -
string sql = "select * " + table_name + " " + english + " ? order " + english + " limit 100"; try { cursor = db.rawquery(sql, new string[]{"%" + englishword + "%"});
for example, in column english
, there "ice", "dice", "vice" etc. when input word "ice" in englishword
, result arranged firstly "dice", followed "ice" , "vice". "ice" on first order because has exact word. how can accomplish this?
use length
function exact matched phrase , should query
string sql = "select * " + table_name + " " + english + " ? order length(" + english + ") limit 100";
Comments
Post a Comment