List:General Discussion« Previous MessageNext Message »
From:Ahmad Al-Twaijiry Date:September 18 2006 9:43pm
Subject:Re: SUM in WHERE
View as plain text  
Hi

I would expect the following result :


[ ID ][ Total ]
[ 1  ][  20     ]
[ 2  ][  30     ]
[ 3  ][  40     ]
[ 4  ][  10     ]


because if you SUM(Total) in  the result  you will see it = 100

On 9/19/06, André Hänsel <haensel@stripped> wrote:
>
> > -----Ursprüngliche Nachricht-----
> > Von: Ahmad Al-Twaijiry [mailto:ahmadt@stripped]
> > Gesendet: Montag, 18. September 2006 23:28
> > An: mysql@stripped
> > Betreff: SUM in WHERE
> >
> [...]
> >
> > I want to run SQL query that will return to me the first
> > records that the
> > SUM of Total field = 100
> >
> > for example
> >
> > SELECT * FROM tbl_name WHERE SUM(Total)=100 ORDER BY ID
> >
> > I know my SQL statment above will not work, could someone help me ?
>
> So what result do you expect from your query?
>
>


-- 

Ahmad Fahad AlTwaijiry

Thread
SUM in WHEREAhmad Al-Twaijiry18 Sep
  • AW: SUM in WHEREAndré Hänsel18 Sep
    • Re: SUM in WHEREAhmad Al-Twaijiry18 Sep
  • Re: SUM in WHEREEdward Macnaghten18 Sep
    • Re: SUM in WHEREAhmad Al-Twaijiry19 Sep
      • Re: SUM in WHEREAhmad Al-Twaijiry19 Sep
        • RE: SUM in WHERERandall Price19 Sep
          • Re: SUM in WHEREAhmad Al-Twaijiry19 Sep
  • Re: SUM in WHEREFelix Geerinckx21 Sep
    • Re: SUM in WHEREAhmad Al-Twaijiry24 Sep
RE: SUM in WHEREQuentin Bennett19 Sep
  • Re: SUM in WHEREDouglas Sims20 Sep
    • Re: SUM in WHEREAhmad Al-Twaijiry24 Sep
      • Re: SUM in WHEREDouglas Sims24 Sep
        • Re: SUM in WHEREAhmad Al-Twaijiry24 Sep
          • Re: SUM in WHEREDouglas Sims25 Sep
            • Re: SUM in WHEREAhmad Al-Twaijiry25 Sep
              • Re: SUM in WHEREPeter Brawley25 Sep
  • adding columns to a large tableHelen M Hudson25 Sep
    • Re: adding columns to a large tableEhrwin Mina25 Sep
      • RE: adding columns to a large tableMugunthan SIFY25 Sep
        • RE: adding columns to a large tableOw Mun Heng25 Sep
    • Re: adding columns to a large tablepraj25 Sep
  • Re: adding columns to a large tableHelen M Hudson25 Sep