You can send queries to the SQLite database of the Android system as raw queries or as parameters. You can practice creating and querying databases at this Fiddle website. Position counting starts at 1 (not zero!). Sorting is by the first column, in this case, the _id. This gives you the last item per sort order. Sorts in reverse and gets the first item. SELECT * FROM WORD_LIST_TABLE ORDER BY word DESC LIMIT 1 Returns the id of the word alpha with the substring art in the definition. SELECT _id FROM WORD_LIST_TABLE WHERE word="alpha" AND definition LIKE "%art%"
0 Comments
Leave a Reply. |