Re: [SQL] Sum of Every Column

2002-10-24 Thread Achilleus Mantzios
Hi tom. In postgresql you cannot have functions with a variable number of parameters. (pgsql supports some kind of method overloading based on the type and number of parameters, thats the reason why). But if you run Unix (with freebsd and linux it is trivial as you will see, with solaris you hav

Re: [SQL] Sum of Every Column

2002-10-23 Thread Josh Berkus
Tom, > I'm hoping to put together a query that generates a report on a table with > a large number of boolean fields. This report has to be able to adapt to > the number of fields in the table. Essentially, I want it to provide the > sum of TRUE values for each field for a given subset of the tab

Re: [SQL] Sum of Every Column

2002-10-23 Thread Jean-Luc Lachance
Tom, You can add sum( case when then 1 else 0 end) for each field that you need. JLL Tom Haddon wrote: > > Hi Folks, > > I'm hoping to put together a query that generates a report on a table with > a large number of boolean fields. This report has to be able to adapt to > the number of fie

[SQL] Sum of Every Column

2002-10-23 Thread Tom Haddon
Hi Folks, I'm hoping to put together a query that generates a report on a table with a large number of boolean fields. This report has to be able to adapt to the number of fields in the table. Essentially, I want it to provide the sum of TRUE values for each field for a given subset of the table.

[SQL] Sum of Every Column

2002-10-23 Thread Tom Haddon
Hi Folks, I'm hoping to put together a query that generates a report on a table with a large number of boolean fields. This report has to be able to adapt to the number of fields in the table. Essentially, I want it to provide the sum of TRUE values for each field for a given subset of the table.