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
- desc
- r/2
- SQL
- 티스토리챌린지
- stratascratch
- DateDiff
- between
- 공공데이터
- SAP HANA
- group by
- ERP
- HAVING
- spa
- limit
- union
- 중복 컬럼
- json
- order by
- over()
- CSV
- R/3
- asc
- S/4 HANA
- Where
- %_%
- 오블완
- left join
- SERVICE_KEY_IS_NOT_REGISTERED_ERROR
- join
- dense_rank()
Archives
- Today
- Total
RE:cord
[SQL] Walmart's Same-Day Orders 본문
select distinct user_id,
count(*) over (partition by user_id) total_n_order,
count(*) over (partition by order_date) total_value
from order_summary
where user_id IN (
select os.user_id
from order_summary os
join sessions ss
on os.user_id = ss.user_id
where ss.session_date = os.order_date
)
order by user_id
'SQL' 카테고리의 다른 글
[SQL/study] UDF (user-defined function) (0) | 2025.01.08 |
---|---|
[SQL] Spotify Penetration Analysis (0) | 2024.12.31 |
[SQL] Matching Grades and Ordering (등급 부여하고 정렬하기) (1) | 2024.12.19 |
[SQL] Daily Active Users (0) | 2024.12.17 |
[SQL] GROUP BY vs PARTITION BY (0) | 2024.12.16 |