I'm struggling with a query. I'm trying to count how many item have actually renter a customer in a table with 1 line per rental. I want to filter the result to see just actual rental so I'm trying to filter by return_date=null but my result return all the entries instead of filtered ones.
Could you please give me a hint?
SELECT
customer_no,
rental_id,
return_date,
COUNT(IF(return_date = null, customer_no,null)) as ActualRental_per_person
FROM
rental_table
GROUP BY
member_no
;
Thanks in advance!