Compound select query in oracle
===

I have a table mealdb which has 3 fields viz. "userid","timeofday","daydate"(all varchar2). timeofday can have 2 values "noon" or "afternoon". Now I want to calculate the total no of afternoons against a given userid.I tried like "select sum(timeofday) from mealdb where timeofday='afternoon' where userid='1200';
But it is giving error in Oracle 10g.Please help.
