sql - Distinct doesn't work -
the below code gives wrong result. using distinct
command type appears 2 times on results.
select distinct concert.concert_id, concert.c_type, count(bookings.customer_customer_id) number_of_customers concert, customer, event, bookings customer.customer_id = bookings.customer_customer_id , event.event_id = bookings.event_event_id , concert.concert_id = event.concert_id group concert.concert_id, concert.c_type order concert.concert_id desc;
results:
distinct means row whole should not duplicated, in case type appears twice difference concert_id , number_of_customers.
Comments
Post a Comment