[UPHPU] OT: SQL Query Question
Jonathan Grotegut
jgrotegut at gmail.com
Wed May 31 10:51:53 MDT 2006
I am using MySQL. I took the SUM off the query so I could find out
what the problem is and forgot to put it back on, sorry. When I put
the SUM on for those two fields it is still including the raid twice
(or more) whenever the player gets more than one item on a raid (which
happens fairly often).
Does anyone know if you do SELECT DISTINCT does it do it on every
column of data or on one particular column?
Thanks again,
Jonathan
On 5/31/06, Brandon Stout <hplsbyufan at imapmail.org> wrote:
> If you do SUM(`items`.`dkpcost`), and/or
> SUM(`raidattendence`.`PointsEarned`), you must use GROUP BY before you
> use ORDER BY, and if you do GROUP BY, that often makes every row
> distinct. If you are summing things at another level than the query,
> you should probably try SELECT DISTINCT, which ensures every row is
> unique. Are you using MySQL, PostgreSQL, or some other database?
>
> Brandon Stout
> http://mscis.org
<snip>
More information about the UPHPU
mailing list