I have set up a query and a cursor. My problem is my cursor seems to be moving 1 column at a time. 
my table is set up with first column as the description string, second column is the grade value and the third column is the weight value.

this is my query:

```
String[] columns = {Calc_db.COLUMN_GRADE_VALUE, Calc_db.COLUMN_WEIGHT_VALUE};
        Cursor cursor = openClass.getBd().query(Calc_db.TABLE_NAME, columns, null, null, null, null, null);

```

I am trying to retrieve the grade and weight value so I can put them in a list. 

```
cursor.moveToFirst();
        while (cursor.moveToNext()){
            Double dbGrade = cursor.getDouble(cursor.getColumnIndex(Calc_db.COLUMN_GRADE_VALUE));
            //cursor.moveToNext();
            Double dbWeight = cursor.getDouble(cursor.getColumnIndex(Calc_db.COLUMN_WEIGHT_VALUE));
            gradeWeightList.add(dbGrade);
            gradeWeightList.add(dbWeight);

```

My problem is the cursor is going through 1 column at a time for each loop iteration. It is also going through all 3 columns even though I am only selecting for the second 2 (grade and weight). 

example:

If i input : description, 0.7, 0.5 (row 1) decript, 0.6, 0.4 (row 2)

I receive:

loop 1: grade = 0.7, weight = 0.0

loop 2: grade = 0.7, weight = 0.5 

loop 3: grade = 0.7, weight = 0.5

loop 4: grade = 0.6, weight = 0.5

loop 5: grade = 0.6, weight = 0.4

What I want is for 

loop 1: grade = 0.7, weight = 0.5

loop 2: grade = 0.6, weight = 0.4
['https://Stackoverflow.com/questions/25353460', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3943131/']
You first go in to the first row by `moveToFirst` and then in the if statement you move the cursor to the second row. You should do something like this:

```
if(cursor.moveToFirst) {

   do {
      // Your Code
     } while (cursor.moveToNext())

}

```
For those of interested this is how I fixed my problem:

(Thanks for the advice Karakuri) 

```
public List<Entry> populateList(){
    List<Entry> gradeWeightList = new ArrayList<Entry>();
    Cursor cursor = data.getBd().query(Calc_db.TABLE_NAME, null, null, null, null, null, null);

    for (cursor.moveToFirst(); !cursor.isAfterLast(); cursor.moveToNext()) {
        String dbDescript = cursor.getString(cursor.getColumnIndex(Calc_db.COLUMN_DESCRIPTION_VALUE));
        Double dbGrade = cursor.getDouble(cursor.getColumnIndex(Calc_db.COLUMN_GRADE_VALUE));
        Double dbWeight = cursor.getDouble(cursor.getColumnIndex(Calc_db.COLUMN_WEIGHT_VALUE));
        Entry e1 = new Entry (dbDescript, dbGrade, dbWeight);
        gradeWeightList.add(e1);    
    } 
    cursor.close();

    return gradeWeightList;

}

```

Entry Class

```
public class Entry {
private double GRADE;
private double WEIGHT;
private String DESCRIPT;

public Entry(){
    GRADE = 0;
    WEIGHT = 0;
    DESCRIPT = " ";
}

public Entry(String description, double grade, double weight){
    GRADE = grade;
    WEIGHT = weight;
    DESCRIPT = description;
}

public String getDESCRIPT(){
    return DESCRIPT;
}
public double getGRADE(){
    return GRADE;
}

public double getWEIGHT(){
    return WEIGHT;
}

public void setDESCRIPT(String description){
    DESCRIPT = description;
}

public void setGRADE(double grade){
    GRADE = grade;
}

public void setWEIGHT(double weight){
    WEIGHT = weight;
}

```

}