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

  • Home
  • SEARCH
  • 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 6541795
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T11:08:55+00:00 2026-05-25T11:08:55+00:00

I have been struggling for hours trying to debug why the following delete query

  • 0

I have been struggling for hours trying to debug why the following delete query actually didn’t delete anything even if the exact same query on the exact same database worked fine in Firefox’ SQLite Manager:

String deleteSql = "DELETE FROM showsummary WHERE url IN (SELECT url FROM showsummary JOIN article_categories USING (url) WHERE categoryid=20 AND title LIKE 'page=%')";
mDb.rawQuery(deleteSql, null);

Since it is a bit complicated with both a JOIN and a sub query my thoughts circled around some limitations in Android’s sqlite implementation regarding sub queries so I tried simplifying the query. But still it didn’t delete anything.

Then I changed it to a select query (just replaced DELETE with SELECT *) and that worked. So probably it was not the join or the sub query that was the culprit after all.

In order to test the select query I had added a moveToFirst() to the returned cursor:

mDb.rawQuery(deleteSql, null).moveToFirst();

When I later changed it back to a delete query again, I forgot to remove the moveToFirst() and then it worked!

It’s nice that it works now, but I am very confused why it is necessary to move the cursor in order to actually delete anything. Is this by design or is it a bug?

  • 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-05-25T11:08:55+00:00Added an answer on May 25, 2026 at 11:08 am

    I cannot answer the why, but another solution is to use .execSQL(String) as posted here

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

Sidebar

Related Questions

I have been struggling with this for the past few hours. All I'm trying
I have been struggling with getting this query right for hours now. I have
Have been struggling with Javascript closure for a while trying to wrap brain around
I have been struggling to find an answer to this theoretical question, even tho
I've been struggling with this problem for 5 hours and I have a feeling
I have been struggling with this seeminly easy problem for 48 hours, and I
I've been struggling for several hours trying to figure out how to get this
I have been struggling trying to test a super simple EJB project in netbeans.
I have been struggling with trying to send an email with an attachment using
I have been struggling for a few hours with all sorts of C tutorials

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.