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

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -