What I\'am doing :
create table sample (id INT(10) PRIMARY KEY AUTO_INCREMENT,name varchar(255),marks INT(10)); insert into sample (name,marks) VALUES(\'sam
Try:
select avg(case marks when null then 0 else marks end) from sample group by name;
Or try and avoid nulls in the table ;)