Home > SQL > How to Use CASE WHEN With SUM() in SQL



How to Use CASE WHEN With SUM() in SQL

In this article, we will explain how to use CASE WHEN with SUM() in SQL


In this article, we will explain how to use CASE WHEN with SUM() in SQL.

In this example, We have created a table of stock buy and sell. and added some of stock record in table .We are using case statement for sum of qty based on buy and sell.

 

SQL

We have explained a create table statement after performing that statement, we have shared the output below.

Screenshot

 

How to Use CASE WHEN With SUM() in SQL

 




Note: All contents are copyright of their authors.



Comments



Leave a Reply

Comment:*
Email ID:*


Name:*