View Full Version : Count ? math via query - help
i tried to count all users posts and calculte them as team posts
like that
COUNT(user.posts) AS totalteamposts
but its count rows and not posts
any idea how i can count all posts via query ?
Carnage
01-25-2005, 02:45 PM
try this:
SELECT sum(user.posts) AS `totalteamposts`
edit: my error should have used ` not ' (i've done this ever since i had the problem of selecting the coloum `mod` from a table... apparently MOD is an sql function, took me hours to figure out what was wrong there...)
filburt1
01-25-2005, 02:51 PM
Don't enclose the table name in quotes.
In ANSI SQL, you should absolutely never use quotes (that I know of) except for literal strings. Column names, numeric values, column aliases, etc. should always be left unquoted.
thanx for help
i used
sum(user.posts) AS teamposts,
worked like charm
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.