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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:38:51+00:00 2026-05-25T12:38:51+00:00

I have Price column in my SQLite table (OrderTable). I want to add all

  • 0

I have Price column in my SQLite table (OrderTable). I want to add all the values in Price column, so that I can have the total price.

For example Price column has 3 values :

150.00  
250.00  
300.00 

How can I get the total amount (700.00) using SQLite query?

  • 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-25T12:38:52+00:00Added an answer on May 25, 2026 at 12:38 pm

    total(X) where x is the column name. Click here to know more about math function in sqlite.

    SELECT total(Price) AS TOTAL_PRICE FROM OrderTable; // will result float value

    SELECT sum(Price) AS TOTAL_PRICE FROM OrderTable // will result int value

    SAMPLE

    CREATE TABLE OrderTable (Price Integer);
    INSERT INTO OrderTable VALUES (1);
    INSERT INTO OrderTable VALUES (2);
    INSERT INTO OrderTable VALUES (3);
    INSERT INTO OrderTable VALUES (NULL);  // NULL
    
    SELECT total(Price) AS TOTAL_PRICE FROM OrderTable;  // output 6.0
    
    SELECT sum(Price) AS TOTAL_PRICE FROM OrderTable     // output 6
    

    From the reference

    The sum() and total() aggregate functions return sum of all
    non-NULL values in the group.

    If there are no non-NULL input rows
    then sum() returns NULL but total() returns 0.0.

    NULL is not normally a helpful result for the sum of no rows but the
    SQL standard requires it and most other SQL database engines implement
    sum() that way so SQLite does it in the same way in order to be
    compatible. The non-standard total() function is provided as a
    convenient way to work around this design problem in the SQL language.

    The result of total() is always a floating point value. The result of
    sum() is an integer value if all non-NULL inputs are integers. If any
    input to sum() is neither an integer or a NULL then sum() returns a
    floating point value which might be an approximation to the true sum.

    Sum() will throw an “integer overflow” exception if all inputs are
    integers or NULL and an integer overflow occurs at any point during
    the computation. Total() never throws an integer overflow.

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

Sidebar

Related Questions

I have a database: http://d.pr/86DH+ I want to divide all numbers in price column
I have a column called price and all the values are TEXT so like
I am using Mysql database. I have 3 table-: table Column tier_price customer_id,sku(Unique),price,website catalog_product
I have a column Name Quote Price in a DataGridView winforms control. I can
I have generated inputs with price values. Example: <input type=text value=59,00/> Now I should
The situation is , I have a table which has for example 10 rows.
I have a procedure that calculates the price of travel based on some values
I have a table with products that have columns like this: price[decimals 8,5] and
I have a database that has three columns Maker, Model and Price and I
Basic question, beginning user. I have a column (price) in a table (room). The

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.