hi,

I think this may solve ur problem

select count(distinct(sid)) from tablename;

its counts the distinct values in a table only