sqlite - Android SQLlite Database query not ordering -


i working sqlite query selecting multiple records database table passing ids db table. want when select records should ordered. not ordering, below query please tell me doing wrong.

"select * tbl_product productid in (" + makeplaceholders(ids.length)+")"+ " order rating desc"; 

it returns records match given ids not in order.

and here makeplaceholders method

public string makeplaceholders(int len){         if(len > 0){         stringbuilder namebuilder = new stringbuilder();         for(int = 0; < len; i++){             namebuilder.append("?").append(",");         }         namebuilder.deletecharat(namebuilder.length() - 1);          return namebuilder.tostring();         } else{             return null;         }     } 


Comments

Popular posts from this blog

c - Bitwise operation with (signed) enum value -

xslt - Unnest parent nodes by child node -

YouTubePlayerFragment cannot be cast to android.support.v4.app.Fragment -