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 <[EMAIL PROTECTED]> wrote:
> -----Ursprüngliche Nachricht----- > Von: Ahmad Al-Twaijiry [mailto:[EMAIL PROTECTED] > Gesendet: Montag, 18. September 2006 23:28 > An: mysql@lists.mysql.com > 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