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
- Data Structure
- Binary Tree
- array
- 자바
- bit manipulation
- SQL
- hash table
- Counting
- Binary Search
- database
- Method
- Math
- string
- dynamic programming
- greedy
- 코딩테스트
- java
- two pointers
- sorting
- simulation
- 코테
- Tree
- 구현
- implement
- Stack
- Class
- Matrix
- geometry
- Number Theory
- 파이썬
Archives
- Today
- Total
코린이의 소소한 공부노트
[LeetCode/Easy] 1890. The Latest Login in 2020 본문
1. Input
1) Table: Logins (pk: (user_id, time_stamp))
2. Output
1) 각 유저별로 2020년 마지막 로그인 날짜를 출력
- 출력 순서는 상관없다.
- 2020년이 아닌 날짜는 출력하지 않는다.
3. Example
4. Code
1) 첫 코드(2023/04/24)
select user_id, max(time_stamp) as last_stamp
from(
select *
from Logins
where year(time_stamp)=2020
) a
group by user_id;
'코딩테스트 풀이 > SQL' 카테고리의 다른 글
[LeetCode/Easy] 2356. Number of Unique Subjects Taught by Each Teacher (0) | 2023.05.02 |
---|---|
[LeetCode/Easy] 1978. Employees Whose Manager Left the Company (0) | 2023.04.24 |
[LeetCode/Easy] 1873. Calculate Special Bonus (0) | 2023.04.22 |
[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 |