0

I want to use Limit and Order By "abc" DESC in Query , i am not getting solution

BuyActivity.this
            .getContentResolver()
                          .update(LearnBirdContactClass.LearbirdTable.SUB_CAT_URI_CONTENT_URI,
                                    contentValuessubcat,
                                    LearnBirdContactClass.SubCategortyTableColumns.CAT_ID
                                            + " = ? AND "
                                            + LearnBirdContactClass.SubCategortyTableColumns.SUB_CAT_ID
                                            + " = ?", new String[] { catId, });

How to add limit and Order By in this

Thanks

Aditay Kaushal
  • 1,021
  • 7
  • 17
  • 1
    "limit" and "order by"? in update??? what would it be for? – pskink Sep 15 '15 at 06:57
  • please refer this link http://stackoverflow.com/questions/9898043/how-to-add-limit-clause-using-content-provider –  Sep 15 '15 at 06:58
  • i want to update only first row of from where id is 5 so why needed limit and order from desc so why? – Aditay Kaushal Sep 15 '15 at 07:19
  • i'm not sure if android's sqlite db supports that, see https://www.sqlite.org/compile.html#enable_update_delete_limit – pskink Sep 15 '15 at 07:28

1 Answers1

0

The SQLite library in Android has not enabled the UPDATE/DELETE LIMIT clause, so even if the content provider had an interface for such a limit (which it hasn't), it would not work.

You have no choice but to uniquely identify the row(s) you want to update.

CL.
  • 173,858
  • 17
  • 217
  • 259