Click here to Skip to main content
16,011,804 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to return count of true/ false in a column of a table. I have a table in sql containing 10 columns with bollean type. Now I have to return the total number of trues and falses in each column and display in each label.
Posted

1 solution

try this.. :)

SQL
select count(*),ColumnName  from TableName group by ColumnName  --(boolean Column)

--here that columnName is boolean column true or false
 
Share this answer
 
v2
Comments
nikolas_ar 21-May-14 3:39am    
Hi

Thanks for quick response.Can you show me the complete fuction count in a label total rows that have value="It Departement" for example.

Thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900