-1
exams = new Select().from(DataExam.class).groupBy("LessonName").where("Favourite = " + 1).execute();

I'm use this code to get data from sql db, but always i get this error

SQLiteException: no such column: Favourite (code 1): , while compiling: SELECT * FROM DataExam WHERE Favourite = 1 GROUP BY LessonName

it's DataExam.class

@Table(name = "DataExam")
public class DataExam extends Model implements Serializable {

@Column(name = "Id")
String Id;

@Column(name = "ExamId")
String ExamId;

@Column(name = "CategorieName")
String CategorieName;

@Column(name = "CategorieText")
String CategorieText;

@Column(name = "CategoriePicture")
String CategoriePicture;

@Column(name = "CategoriePictureThumb")
String CategoriePictureThumb;

@Column(name = "CategorieSortOrder")
public String CategorieSortOrder;

@Column(name = "Favourite")
public Boolean Favourite;

@Column(name = "LessonName")
public String LessonName;

...more code

in what cases is such a mistake possible except for the columns not found

alexander.polomodov
  • 5,396
  • 14
  • 39
  • 46

1 Answers1

0

This error mostly occurs if column name is mis-spelled or column is not being created. You can verify that either your columns are actually being created or not. Use this library to see if the columns are being created. Local Database Viewer Library it is an amazing library.

MezzDroid
  • 560
  • 4
  • 11