Untitled

mail@pastecode.io avatar
unknown
plain_text
2 years ago
940 B
4
Indexable
Never
        SQLiteDatabase db = vtabani.getSqlLiteDatabase();
        String[] SELECT = {"_id", "_conjunction", "_gler", "_column", "_meaning", "_sentence"};
        String str_filt = "((";
        for (int i = 0; i < gler_filter.size(); i++)
        {
            str_filt += "_gler=" + gler_filter.get(i);
            if (i != gler_filter.size() - 1)
                str_filt += " or ";
        }
        str_filt += ") and (";
        for (int i = 0; i < ller_filter.size(); i++)
        {
            str_filt += "_ller=" + ller_filter.get(i);
            if (i != ller_filter.size() - 1)
                str_filt += " or ";
        }
        str_filt += ") and (_id NOT LIKE '" + question.id + "'))";
        //Log.e("1", "1str_filt: " + str_filt);
        Cursor cursor = db.query("(select random() as r, * from t_gler WHERE " + str_filt + ")", SELECT, null, null, null, null, "r LIMIT 1;");
        question.id = null;