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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:10:01+00:00 2026-05-25T23:10:01+00:00

in my database having some row’s , in every row having three column’s(id, name,

  • 0

in my database having some row’s , in every row having three column’s(id, name, moves, time). i want to sort the rows depending on the moves this is the integer value.

i tried like this but unlucky.

public Cursor fetchAllNotes() {
    return db.query(DATABASE_TABLE, new String[] { KEY_ROWID, KEY_NAME, 
         KEY_MOVES,KEY_TIME}, null, null, null, null, KEY_MOVES);
}

used like this

private void getallrows()  {
    // get all the contacts..
    db.open();
    Cursor c = db.fetchAllNotes();       
    if (c.moveToFirst())   {        
       do {
          Sorting(c);
       } while (c.moveToNext());
    }
    db.close();
}

moves i have like 15, 45, 21, 11, 10,75,33
i want like this 10,11,15,21,33,45,75

  • 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-25T23:10:02+00:00Added an answer on May 25, 2026 at 11:10 pm

    Try this –

    return db.query(DATABASE_TABLE, new String[] { KEY_ROWID, KEY_NAME, 
             KEY_MOVES,KEY_TIME}, null, null, null, null, KEY_MOVES + " ASC");
    

    or

    return db.query(DATABASE_TABLE, new String[] { KEY_ROWID, KEY_NAME, 
             KEY_MOVES,KEY_TIME}, null, null, null, null, KEY_MOVES + " DESC");
    

    EDIT – 1:

    If you want to display name,you can use like this,

    private void getall()
    { 
            db.open(); 
            Cursor c = db.fetchAllNotes();
            int i=1; 
            if (c.moveToFirst())
            {               
                do
                {
                    DisplayContact(c.getString(c.getColumnIndex(KEY_NAME))); 
                    i++;
                } while (c.moveToNext()); 
            } 
            db.close(); 
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im having some trouble with an oracle database. Every time i try to connect,
I'm having some trouble updating a row in a MySQL database. Here is the
I want to take some data from the database and arrange it into rows
I have a table in database that is having some fields one of which
I'm having some trouble with a SQL Server 2005 database that seems like it's
I'm having some trouble with the ASP.NET 2.0 Login Control. I've setup a database
For some reason I'm having a problem retrieving data from my database. It leaves
I have a MySQL database with some URLs in it. One URL per row.
I'm having trouble saving a new row in the DataGridView back to the database.
i need some help with inserting multiple rows from different arrays into my database.

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.