Probably a join with customer table is required, because values like customer.customer_id are undefined. Check the tutorial.
New error in this query?
Hi again,
Here is a query copied from a training video: it worked in the record, but not for me:
select customer.customer_id
, customer.first_name
, customer.last_name
, count (*) as "Count of Rentals"
from film
inner join inventory
on inventory.film_id = film.film_id
inner join rental
on rental.inventory_id = inventory.inventory_id
left join payment
on payment.rental_id = rental.rental_id
and payment.customer_id = customer.customer_id
group by customer.customer_id
, customer.first_name
, customer.last_name
order by 4 desc;
and I get this error message:
LINE 12: and payment.customer_id = customer.customer_id
^
SQL state: 42P01
Character: 337
Can you please help me?