----- Original Message ----- From: "Umesh Persad" <[EMAIL PROTECTED]>
To: <sqlite-users@sqlite.org>
Sent: Tuesday, January 16, 2007 10:32 AM
Subject: [sqlite] SQL query problem


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?

I'm wondering if your population values have commas in them? "1,774" This *may* cause some trouble for the SUM function.
Just a thought.
DanB


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

Reply via email to