我只想问这是否是使用 select、from 等的正确方法,以及我的条件是否正确:
private Cursor delete(){
calendarData = new CalendarData(this);
SQLiteDatabase db = calendarData.getWritableDatabase();
String mySQL = " select"+ _ID+ "from " + TABLE_NAME + "where" + _ID + "==" + deleteAnAppointment.getText().toString();
Cursor idToDelete = db.rawQuery(mySQL, null);
startManagingCursor(idToDelete);
return idToDelete;
}
private void selectToDelete(Cursor cursor){
calendarData = new CalendarData(this);
SQLiteDatabase db = calendarData.getWritableDatabase();
if(cursor.getCount() > 0){
db.delete(TABLE_NAME, _ID+" = "+deleteAnAppointment.getText().toString(), null);
}
}
反正我没有得到任何结果,只是想看看它是否是格式化 SQL 的正确方法,谢谢