I am trying to return the number of clients in a certain state who have rented a particular movie, where the annuity table contains two columns, one for the client identifier and one for the film identifier. The function takes the movie ID and status and returns an integer with the number of clients.
Now I have an implementation, but it counts the number of rows that the entire query returns:
SELECT COUNT(*) as numCustomers FROM CUSTOMER C, RENTS R WHERE C.ST = '" + state + "' AND R.mid = " + movieID
And then I count the number of rows. I would just check numCustomers for the correct data. Thanks!
The big l
source
share