android - SQLite: Need a SELECT query to filter a row and sort by a value passed in WHERE condition -


to make understandable following link in w3schools can taken example.

environment: android, sqlite.

problem: instance

  1. select value column name "city", return array.
  2. but need city "cork" index 0 of array returned along other city names sorted alphabetically.

this problem statement. please suggest if there solution @ or worth trying way.

thank !

there question similar this. answer use temporary table selected order by, select * there union other selection. query came , tested is:

select distinct city customers city='cork' union select * (select distinct city customers city<>'cork' order city asc) 

the question refer to. sadly, using union instead of union all didn't work.


Comments