Hi Umesh,

What is the table structure of your SQLite table? Is it what you want
it to be? I am assuming "population" should be integer, as you can't
really have fractional people.

Did you check your imported data and see if it looks the same as in Excel?

Did all the data import? Probably yes because you say that you
exported SQLite back into Excel, and the sum is once again your
expected value. Still, no harm in doing a quick "SELECT Count(*) FROM
people" to see how many rows you have.


On 1/16/07, Umesh Persad <[EMAIL PROTECTED]> wrote:
Hi,
I was wondering if anyone can help with a problem I have having with SQL.
I have a table 'people' in a Sqlite database with a column 'population'.
All I
want to do is to add up all the values in this column. When the data is
in an
Excel file, the column adds up to 8,581,774.

I used the SQlite Database Browser (http://sqlitebrowser.sourceforge.net/)
to get the data into a Sqlite database and ran the following query:

SELECT SUM(population) FROM people

I am supposed to get 8,581,774 but instead I am getting 14898.38. I
exported
the data back out to a csv file and checked it in Excel and all the data
was there
adding up to 8,581,774.

So is there something wrong with my query or should the query be
different with
Sqlite?

Thanks for any advice,

Umesh Persad



--
Puneet Kishor http://punkish.eidesis.org/
Nelson Inst. for Env. Studies, UW-Madison http://www.nelson.wisc.edu/
Open Source Geospatial Foundation http://www.osgeo.org/education/
---------------------------------------------------------------------
collaborate, communicate, compete
=====================================================================

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to