select count(distinct uid) from ib_user_settings;
参考: http://www.w3school.com.cn/sql/sql_distinct.asp