MySQL Selecting Table Excluding Columns Which Sum is equal 0
I need some help with MySQL syntax. I need to SELECT 开发者_运维技巧whole table, ignoring columns which SUM = 0...
Is it possible knowing that I can't use the columns names in SQL syntax?
You can't do SUM(*)
. it has to be on a particular column, so you'd have to select sum(a), sum(b), sum(c), etc...
, and once you're doing selecting multiple columns with aggregate functions, you'll need to group on all those fields as well.
Not possible, pull down the whole record and through the view code, simply don't display the column if it factors out to 0.
精彩评论