PHP & MySQL Using SUM and CASE in statement

As an alternative to general SQL statement, sometimes you can use built-in MySQL function to help in some complex statement. This article will demonstate of how to use SUM and CASE in the SQL statement. This will work like SQL Count() statement.