Total Number Of Some Column


SELECT COUNT(SomeColumnName) FROM SomeTable WHERE ...
SELECT SomeColumnName, COUNT(SomeColumnName) FROM SomeTable WHERE ... GROUP BY SomeColumnName

	//You can read it like this
	TotalVideosInSection = Convert::ToInt32(Row[0]);

Total Number Of Rows


SELECT COUNT(*) FROM SomeTable WHERE ...

Sum Of Some Column


SELECT SUM(SomeColumnName) FROM SomeTable WHERE ...

Total Number Of True


SELECT SUM(CONVERT(int, SomeBoolColumnName)) FROM SomeTable

Total Number Of False


SELECT COUNT(SomeBoolColumnName)-SUM(CONVERT(int, SomeBoolColumnName)) FROM SomeTable

Grouping Results

Use GROUP BY

Feel free to comment if you can add help to this page or point out issues and solutions you have found. I do not provide support on this site, if you need help with a problem head over to stack overflow.

Comments

Your email address will not be published. Required fields are marked *