philosophaie — 2013-12-09T03:19:26-05:00 — #1
I have marked a column "index" in a table "count" every time I visit the website with a "1".
I would like the SQL statement that would add up all the "1"s and give the site counter a value.
There are some blank spaces where other websites with different columns in table "count" were recorded.
"SELECT SUM(index) FROM count;"
but this yielded the blank cell.
guido2004 — 2013-12-09T03:34:00-05:00 — #2
That query should give two errors, because index and count are reserved words. Enclose them in backticks, or even better, give table and column another name.
And when you say "blank spaces" that worries me, isn't the "count" column numerical?
r937 — 2013-12-09T07:49:44-05:00 — #3
only if OP is using mysql
OP didn't say which database system, though