TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Rollup for multiple fields in MySQL

4 pointsby sGrabberabout 12 years ago
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

2 comments

mooism2about 12 years ago
I have no idea what this even means.<p>Try asking on <a href="http://dba.stackexchange.com" rel="nofollow">http://dba.stackexchange.com</a> if this is a database administration question, or on <a href="http://stackoverflow.com" rel="nofollow">http://stackoverflow.com</a> if it is a programming question.
评论 #5468722 未加载
lazyfunctorabout 12 years ago
I am not sure if I get your question. I think this query should work<p>"select country, state, city, SUM(sales), SUM(profit) from foo group by country, state, city with rollup;"<p>for a table with country, state, city, sales, profit as columns
评论 #5469790 未加载