在游标中查询

时间:2011-09-25 08:39:28

标签: java android database

我有一张1到多人的表:

      name    
  _id ## name ##
   1     tony

         points
 _marksid## date ## point
  1       13       55 
  1       23       55
  1       24       69
  1       31       77

我有光标:

   Cursor cursorMarks = database.query(points,
        new String[] {"point"},
        "_marksid=1", null,null,null,null); 

我想:

  select point from points   where _marksid="1"

为什么那些无法正常工作?

我有周期:

 TableRow row = (TableRow)findViewById(R.id.tableMarks);
  cursorMarks.moveToFirst();
  do { 

      TextView textView = new TextView(this);
      textView.setText(cursorMarks.getString(0));
      row.addView(textView); 
  } while (cursorMarks.moveToNext());

0 个答案:

没有答案