|
sum the values in a group by statement....: msg#01087db.mysql.general
Hi, Can someone give me the mysql syntax or a reference link where I can learn how to group the values in a select statement and also ADD the values of some of the columns. For example: select column1, column2, column3 from table1 group by 1 asc,2 desc; I want the values presented in the column3 to be the sum of all the rows that matched the group condition. Am I clear enough? Thank you. Ciprian --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <mysql-thread113336@xxxxxxxxxxxxxxx> To unsubscribe, e-mail <mysql-unsubscribe-gcdmg-mysql=m.gmane.org@xxxxxxxxxxxxxxx> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: timestamp auto update disabling: 01087, MikeParton |
|---|---|
| Next by Date: | RE: [PHP-DB] Re: XML: 01087, Peter Lovatt |
| Previous by Thread: | lost connectioin error!!i: 01087, Anil Garg |
| Next by Thread: | sum the values in a group by statement....: 01087, Ciprian I. Acatrinei |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |