문제
SQLite
내가 작성한 오답

: order_id에 distinct를 사용하지 않아 같은 주문번호가 여러번 카운트 되어 오답처리 됐다.
select payment_installments,
count(order_id) order_count, min(payment_value) min_value,
max(payment_value) max_value, avg(payment_value) avg_value
from olist_order_payments_dataset
where payment_type = 'credit_card'
group by payment_installments
내가 작성한 정답
select payment_installments,
count(distinct order_id) order_count, min(payment_value) min_value,
max(payment_value) max_value, avg(payment_value) avg_value
from olist_order_payments_dataset
where payment_type = 'credit_card'
group by payment_installments
Share article