Skip to content

Latest commit

 

History

History
7 lines (7 loc) · 263 Bytes

1393. Capital Gain Loss.md

File metadata and controls

7 lines (7 loc) · 263 Bytes

1393. Capital Gain/Loss

Question Link

Solution

# Write your MySQL query statement below
select stock_name, sum(if(operation='Sell',price,-price)) capital_gain_loss from Stocks group by stock_name