Reputation: 1
To help finalise financial records for the 1st quarter of the year, management needs to know candidates who have not paid their fees in order to contact them.
For this question i wrote a query:
SELECT ENROLL_FEEPAID, COUNT(Not Paid)
FROM ENROLL
GROUP BY Not Paid
HAVING ( COUNT(Not Paid) > 1 );
but got an error saying
#1054 - Unknown column 'Paid' in 'field list'
can anyone help me correct my query
Upvotes: 0
Views: 31
Reputation: 427
There is a space in the fieldname so you must use the field name delimiter.
In mysql you need the backtick ` so
SELECT ENROLL_FEEPAID, COUNT(`Not Paid`) FROM ENROLL GROUP BY `Not Paid` HAVING ( COUNT(`Not Paid`) > 1 );
Upvotes: 1