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 7728639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:46:09+00:00 2026-06-01T05:46:09+00:00

I have executed a rawQuery in android that returns multiple results that point to

  • 0

I have executed a rawQuery in android that returns multiple results that point to different rows.

example:  Cursor cursor = db.rawQuery("Select id as _id, List_id, Street_id FROM Streets WHERE Street_id = 5, null);

In my table, this would return two rows:

List_id = 2, Street_id = 5 
List_id = 7, Street_id = 5

I then want to update a column named Counter in a separate table for the two rows that List_id 2 and List_id 7 would correspond too (which would be _id = 3 and _id = 8) in my other table.

I understand I will have to do some cursor management.but I would really appreciate it if someone could give me some general basics to get started – I have been struggling on this pretty hard.

BETTER EXAMPLE:

I query my Streets table for all records where my Street_id = 5. I get two results. Within those returned rows, I have a column called List_id. The data in the two List_id columns are 2, and 5. I need to then update a field named Counter my Lists table based on the _id that is equal to 2 and 5.

  • 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-01T05:46:10+00:00Added an answer on June 1, 2026 at 5:46 am

    it looks like all you gotta do is have where clause in your update query also.

    String filter = "Street_id=" + 5; 
    ContentValues args = new ContentValues(); 
    args.put(Counter, "value"); 
    myDB.update("Streets", args, filter, null);
    

    that should do the job

    EDIT

    db.rawQuery("update Streets (Counter) Set (Value) Where Street_id=5, (Value) Where Street_id=5");
    

    this will update value in two rows, you can dynamically generate this query depending upon how many row’s previous query returns.

    EDIT

    ok, let’s try

    db.rawQuery("update Lists (Counter) Set (Value) Where _id=2, (Value) Where _id=5");
    

    please explain with example if that’s not what you want or where you are having trouble with

    above query will update Counter column in Lists table with Value where first row’s _id = 2 and second row’s _id=5.

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

Sidebar

Related Questions

I have executed a code SELECT CASE b.ON_LOAN when 'Y' then 'In Lib' when
I have successfully executed a project in a system,with Android 2.2... When i ran
I have a controller action that is being executed by a link that was
I have a thread that needs to be executed every 10 seconds. This thread
I have data that needs to be executed on a certain background thread. I
I have an application that runs fine when executed off the server. When clients
I have executed two identical bcp commands on two different setups with the same
I have an issue that, while using sql server 2005 i have executed update
I am using SQLite in Android. I have the query, query executed and how
I have executed a routine that was doing a lots of data transformation and

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.