문제
입력 코드
SELECT
ROUND(AVG(order_date = customer_pref_delivery_date) * 100, 2) AS immediate_percentage
FROM Delivery
WHERE (customer_id, order_date) IN (
SELECT customer_id, MIN(order_date)
FROM Delivery
GROUP BY customer_id
)
코드 설명
#SELECT #ROUND #AVG #MIN #GROUP BY #SUBQUERY
문제 출처
'SQL' 카테고리의 다른 글
#97. [LeetCode / MySQL] 2356. Number of Unique Subjects Taught by Each Teacher (0) | 2023.09.23 |
---|---|
#96. [LeetCode / MySQL] 550. Game Play Analysis IV (0) | 2023.09.22 |
#94. [LeetCode / MySQL] 1193. Monthly Transactions I (0) | 2023.09.20 |
#93. [LeetCode / MySQL] 1211. Queries Quality and Percentage (0) | 2023.09.19 |
#92. [LeetCode / MySQL] 1633. Percentage of Users Attended a Contest (0) | 2023.09.18 |