group extra colums
Hello everyone,
mysql group by with rollup is a very good tool to analyze data.
My question is, what if i want populate extra column with the report but summarized. for example, i want to report sum(amount) summarized with year and sales person, so, i wrote sql something like
select sum(amt),year,salesid group by year,salesid with rollup
Now my report also needs info about sales first name, last name, email, phone,... if I group all of them to my query, it will populate too many redundant lines.
So, any body can let me know how to populate extra columns attached to key column without applying group by clause?
Thank you in advance,
Jun
|