Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
Tags
- Method
- implement
- hash table
- database
- simulation
- 코딩테스트
- Matrix
- Counting
- 파이썬
- bit manipulation
- geometry
- Class
- java
- Math
- Number Theory
- SQL
- 구현
- dynamic programming
- string
- Binary Tree
- two pointers
- Stack
- array
- 코테
- Tree
- sorting
- Binary Search
- greedy
- 자바
- Data Structure
Archives
- Today
- Total
코린이의 소소한 공부노트
[LeetCode/Easy] 1693. Daily Leads and Partners 본문
1. Input
1) Table: DailySales (pk: 없음)
2. Output
1) 각 날짜와 이름별로 lead_id와 partner_id의 수를 센 결과를 출력
- 중복은 세지 않는다.
- 출력 순서는 상관 없다.
3. Example
4. Code
1) 첫 코드(2023/04/15)
select a.date_id, a.make_name, a.unique_leads, b.unique_partners
from (select date_id, make_name, count(distinct lead_id) as unique_leads
from DailySales group by date_id, make_name) a,
(select date_id, make_name, count(distinct partner_id) as unique_partners
from DailySales group by date_id, make_name) b
where a.date_id=b.date_id and a.make_name=b.make_name;
'코딩테스트 풀이 > SQL' 카테고리의 다른 글
[LeetCode/Easy] 1757. Recyclable and Low Fat Products (0) | 2023.04.17 |
---|---|
[LeetCode/Easy] 1741. Find Total Time Spent by Each Employee (0) | 2023.04.17 |
[LeetCode/Easy] 1683. Invalid Tweets (0) | 2023.04.15 |
[LeetCode/Easy] 1378. Replace Employee ID With The Unique Identifier (0) | 2023.04.11 |
[LeetCode/Easy] 1148. Article Views I (0) | 2023.04.06 |