FW: How do I (can I) use aggregate functions inside a select

2008-07-25 Thread David Ruggles
Sum() is driven by the group by. I need it to be equivalent to this: Select company, state, sales, sales / (select sum(sales) from sales) as percent from sales Which of course I could just use that, but the select I'm actually working with isn't that simple and if there was some way to do what I

Re: FW: How do I (can I) use aggregate functions inside a select

2008-07-25 Thread Mr. Shawn H. Corey
Why? Because it's Friday and I'm feeling silly :) mysql SELECT * FROM sales; +--+---++ | company | state | sales | +--+---++ | ABC | AZ| 140.01 | | XYZ | AZ| 17.76 | | ABC | NY| 123.45 | | XYZ