4 ms·
Rollup for multiple fields in MySQL
I am able to run rollup for single field but unable to do for multiple fields in MySQL.
Any idea how can we do rollup on multiple fields
- mooism2 14y agoI have no idea what this even means. Try asking on http://dba.stackexchange.com http://dba.stackexchange.com if this is a database administration question, or on http://stackoverflow.com http://stackoverflow.com if it is a programming question.
- sGrabber 14y agoThanks. I am looking it up at various places. Rollup is a db command
- lazyfunctor 14y agoI am not sure if I get your question. I think this query should work "select country, state, city, SUM(sales), SUM(profit) from foo group by country, state, city with rollup;" for a table with country, state, city, sales, profit as columns
- sGrabber 14y agoThanks. Had tried this way taking multiple fields but it didnt work. Will try again and update you. Once again thanks for the inputs, really appreciate