Skip to content

Commit a223214

Browse files
add 1393
1 parent 2936e19 commit a223214

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,7 @@ _If you like this project, please leave me a star._ ★
11051105
|1484|[Group Sold Products By The Date](https://leetcode.com/problems/group-sold-products-by-the-date/)|[Solution](../master/database/_1484.sql) || Easy |
11061106
|1445|[Apples & Oranges](https://leetcode.com/problems/apples-oranges/)|[Solution](../master/database/_1445.sql) || Medium |
11071107
|1407|[Top Travellers](https://leetcode.com/problems/top-travellers/)|[Solution](../master/database/_1407.sql) || Easy |
1108+
|1393|[Capital Gain/Loss](https://leetcode.com/problems/capital-gainloss/)|[Solution](../master/database/_1393.sql) || Easy |
11081109
|1384|[Total Sales Amount by Year](https://leetcode.com/problems/total-sales-amount-by-year/)|[Solution](../master/database/_1384.sql) || Hard |
11091110
|1378|[Replace Employee ID With The Unique Identifier](https://leetcode.com/problems/replace-employee-id-with-the-unique-identifier/)|[Solution](../master/database/_1378.sql) || Easy |
11101111
|1369|[Get the Second Most Recent Activity](https://leetcode.com/problems/get-the-second-most-recent-activity/)|[Solution](../master/database/_1369.sql) || Hard |

database/_1393.sql

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
select stock_name, sum(
2+
case
3+
when operation = 'Buy' then -price
4+
else price
5+
end
6+
) as capital_gain_loss from Stocks group by stock_name;

0 commit comments

Comments
 (0)