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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T01:58:14+00:00 2026-06-06T01:58:14+00:00

Platform: SQLite on Android. Problem: table has three columns – id, title and order.

  • 0

Platform: SQLite on Android.

Problem: table has three columns – id, title and order. Data in table has some “duplicate” order records, for example, there are 2 records with order “3” (example bellow). Order value also have “holes” in them – for example, there is no order value “2”.

Example table and select to pull it: *select _id,title,order from table order by order;*

_id         TITLE      ORDER    
----------  ----------  ----------
5           First        0         
19          Second       1         
1           Third        3         
4           Fourth       3         
3           Fifth        5         
16          Sixt         7        

What is needed? Is there a way to update current records in table to “reset” values in ORDER column, while preserving as much as possible. Possible result after update that would be optimal is:

_id         TITLE      ORDER    
----------  ----------  ----------
5           First        0         
19          Second       1         
1           Third        2         
4           Fourth       3         
3           Fifth        4         
16          Sixt         5        

Anyone has idea how to do this on SQLite running on Android? If this was Oracle and SQLServer I could be using #temp tables or cursors, but here…?

  • 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-06T01:58:16+00:00Added an answer on June 6, 2026 at 1:58 am

    There may be a better solution, but I would simply select and save them into an array in the order that you want. Then you can loop through with a for loop and update the ORDER field for each record using the for loops iterator value.

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

Sidebar

Related Questions

I am trying to convert an existing Android, SQLite database to a multi-platform, SQLite
I am using phonegap and sqlite to develop cross-platform mobile app for android,ios,blackberry.For reference
I'm using the built in sqlite library on the Android platform. I'm considering adding
Possible Duplicate: Where does Android emulator store SQLite database? I am using SQLite and
For Android Platform: I need to put Hebrew Character ₪ and some more like
I have created an SQLite FTS3 table that I am using within the Android
I have a weird problem with the Android emulator. I have created a virtual
my scenario : on my work on android sqlite i noticed I need to
I am new to android platform. I am working on a project in which
I have a table with two columns n integer and s varchar. n is

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.