So I have the following Oracle SQL Database table:
create table Customer
(customerID char(25) not null,
name char(50),
address char(100),
dateRegistered DATE,
noOfDvdHiring int,
primary key (customerID));
And I have the following query: List the unique numbers and names of all customers who are hiring more DVDs than the average number of DVDs currently hired by all customers.
I'm sure this should involve a nested query but I am unsure where to start?
I have tried:
SELECT customerID, name
FROM Customer
WHERE noOfDvdHire > AVG(noOfDvdHire);
But receive this error message: ORA-00934: group function is not allowed here