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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T15:21:18+00:00 2026-06-03T15:21:18+00:00

I have implemented a Database in my project and following several tutorials, have been

  • 0

I have implemented a Database in my project and following several tutorials, have been able to pull data and display in listviews. I, however, have not been able to search and find a solution to my current problem.

I have two columns in a table. The columns are: TABLE_UNITS and TABLE_PRICE and they are in the table TABLE. I want to display a combined portfolio of sorts where each rows, UNITS and PRICE have to be multiplied and this sub total will be added for each row present in the database. To make it clearer:

UNITS —- PRICE —- TOTAL

50————5———–250

20————10———-200

GRAND TOTAL ——- 450

So the question is, how do I pull all this information into, say a string, and then calculate and then get the next row, do the same calculation and get the Grand Total?

  • 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-03T15:21:20+00:00Added an answer on June 3, 2026 at 3:21 pm

    Perhaps this query can help you:

    Cursor c = db.rawQuery("SELECT TABLE_UNITS, TABLE_PRICE,
               (TABLE_UNITS * TABLE_PRICE) AS TOTAL FROM table;", null);
    

    for grand total, you need to run a separate query:

    Cursor c = db.rawQuery("SELECT SUM(TABLE_UNITS * TABLE_PRICE) AS GRAND_TOTAL
               FROM table;", null);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table in database which has following structure(data) : +--------------------------+ Organization +--------------------------+
In our project we have several production databases and many devs. Each production database
I wants to have some knowledge about how database management software is implemented. Is
I have a database where I store two different kinds of data. One table
I have implemented the Unity DI in a project of mine, but I have,
I've been using repositories for data access for some time now but have never
I am building a project which requires multiple database support. This has been relatively
Hello Entity Frameworks Gurus!! I've been following the official tutorial and have started a
I'm working on a WinForm application. I've implemented data-access logic into a library project
I'm currently having the following issue in my project: I'm using Core Data to

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.