how add limit clause to manageQuery on android

前端 未结 5 1911
没有蜡笔的小新
没有蜡笔的小新 2021-02-10 03:00

Android\'s API provides a clean mechanism via SQLite to make queries into the contact list. However, I am not sure how to limit the results:

Cursor cur = ((Acti         


        
5条回答
  •  清歌不尽
    2021-02-10 03:39

    I found out from this bug that Android uses the following regex to parse the LIMIT clause of a query:

    From

    LIMIT clause is checked with following sLimitPattern.

    private static final Pattern sLimitPattern = Pattern.compile("\\s*\\d+\\s*(,\\s*\\d+\\s*)?");
    

    Note that the regex does accept the format offsetNumber,limitNumber even though it doesn't accept the OFFSET statement directly.

提交回复
热议问题