Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7743987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:40:08+00:00 2026-06-01T09:40:08+00:00

I have to execute the following query in Android SQLite UPDATE player SET rank=rank+1

  • 0

I have to execute the following query in Android SQLite

UPDATE player SET rank=rank+1 WHERE rank >= 3;

Here rank is the column name of INTEGER type.

I know about update method

update(tablename, values, whereClause, whereArgs);

I will pass player as first argument, rank >= 3 as 3rd argument and null as last argument but I am unable to find what to pass as 2nd argument. According to the docs it should be an object of ContentValues.

so I created its object as

ContentValues values = new ContentValues();
values.put("rank",?????);

I am confused about what to put the value for rank key which is a column in my table. Please suggest me what to pass as value to put() method of values

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T09:40:08+00:00Added an answer on June 1, 2026 at 9:40 am

    I believe update method is not One-Size-Fit-All method. So I think you need to use rawQuery() to achieve this kind of sql execution. for example:

    db.rawQuery("UPDATE player SET rank=rank+1 WHERE rank >= 3;", null);
    

    or perhaps use execSQL as said by el7r

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to execute the following query. I don't have 'CrewID' column so
I have following query which take more than a minute to execute, how can
I want to execute the following update query at PostgreSQL db but it does
I have the following query: UPDATE lessonstatus INNER JOIN user ON lessonstatus.user_id = user.user_id
I have a table with one field of enum type. I execute the following
I have problem with following query: SELECT g_contac.contid, g_contac.name, g_contac.email, f_sync.foreign_key, ( SELECT COUNT(g_cpers.cpersid)
I have following query in my project, $values = array(test=>value) $this->_db->update(tablename,$values,array('id = ?'=> $data['id'],'wid
I have following query which takes almost 1 minute to execute. public static Func<Entities,
I have the following query: DECLARE @sync_table_name nvarchar(500) SET @sync_table_name = 'ContactTypes' DECLARE @sync_batch_size
I have an application that executes the following MySQL query: SELECT 402 AS user_id,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.