Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.php > #6058
| From | Mike <mpearl1@gmail.com> |
|---|---|
| Newsgroups | comp.lang.php |
| Subject | Re: Transforming object properties? |
| Date | 2012-05-09 14:57 -0700 |
| Organization | http://groups.google.com |
| Message-ID | <21352106.71.1336600630360.JavaMail.geo-discussion-forums@pbmf10> (permalink) |
| References | <16764404.423.1336520688722.JavaMail.geo-discussion-forums@pblw1> <t7gjq7hidbohqkohouq8rg3i7tlv0ecai4@4ax.com> |
I didn't do a good job of presenting this, my apologies. I have two tables, one with user info, the other with commission amounts. I need to get a list of sales people that gives the total commissions for each status (there are four of them). My SQL query looks like this: SELECT name, status, SUM(commission) FROM transactions GROUP BY name, status ORDER BY name ASC This is giving the right results, but I will have multiple rows for each name, showing the status and total for that status: Joe new 10.00 Joe pending 44.00 Joe closed 88.00 etc. I need a single row for each name, something like this: name new pending closed Joe 10.00 44.00 88.00 Is there a way to create a sql query that will return this? If not, how can I get the data in that format? Thanks again! Joe
Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Transforming object properties? Mike <mpearl1@gmail.com> - 2012-05-08 16:44 -0700
Re: Transforming object properties? Jeff North <jnorthau@yahoo.com.au> - 2012-05-09 11:01 +1000
Re: Transforming object properties? Mike <mpearl1@gmail.com> - 2012-05-09 14:57 -0700
Re: Transforming object properties? Captain Paralytic <paul_lautman@yahoo.com> - 2012-05-10 03:24 -0700
Re: Transforming object properties? Jeff North <jnorthau@yahoo.com.au> - 2012-05-15 10:28 +1000
Re: Transforming object properties? Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2012-05-15 20:09 +0200
Re: Transforming object properties? "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-05-09 10:02 +0200
Re: Transforming object properties? "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-05-09 10:05 +0200
csiph-web