Ivo <[EMAIL PROTECTED]> wrote: > What is the trick for writing a SQL that gives me running totals of some > values? For example, I have a table with values like this: > > Field1 > 1 > 2 > 3 > 4 > > and I want a SQL to return something like this: > > 1 > 3 > 6 > 10 >
You can do something like: SELECT @sum:=0; SELECT @sum:[EMAIL PROTECTED] FROM table_name; -- For technical support contracts, goto https://order.mysql.com/?ref=ensita This email is sponsored by Ensita.net http://www.ensita.net/ __ ___ ___ ____ __ / |/ /_ __/ __/ __ \/ / Egor Egorov / /|_/ / // /\ \/ /_/ / /__ [EMAIL PROTECTED] /_/ /_/\_, /___/\___\_\___/ MySQL AB / Ensita.net <___/ www.mysql.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]