select count(distinct user_id) as cnt from table where time between start and end
select count(distinct user_id) as cnt from table where time between start and end and province in (上海,北京)
select count(distinct user_id) as cnt from table where time between start and end and province in (江苏,浙江) and city in ('南京','杭州')