Wednesday, 8 April 2015

Delete column and row in the sqlite database using android


   In my previous post I have explained how to insert values in database using SQLite.Now I am going to explain about deleting the values in database using SQLite.



      public void deleteChat(String GroupId
                {
String deleteQuery =  
                                "Delete   FROM " + "TableName"+ "  Where  "
+ "" + "Group"+ " in " + "(" + GroupId + ")";
SQLiteDatabase db = getWritableDatabase();
db.execSQL(deleteQuery);

              }

            "TableName"=Name of the Table
            "Group"=Column Name

Syntax:
          
            Delete from TableName where columnName in(id);


Happy Coding:)