Tuesday, November 16, 2010

[android-developers] How to arrange the primary key in ascending order

I have a table like this

public void insertToSwitchTable(String switchName,int roomID,String
roomName)
{
sampleDB.execSQL("CREATE TABLE IF NOT EXISTS " +
SWITCH_TABLE_NAME +
"(SwitchID integer primary key
autoincrement,SwitchName VARCHAR,RoomID integer,RoomName VARCHAR);");


sampleDB.execSQL("INSERT INTO " +
SWITCH_TABLE_NAME +
" Values (null,'"+switchName+"','"+roomID+"','"+roomName
+"');");
}


Now I want to arrange the records according to ascending order of
RoomID. How to do this?

Thanks.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate