I have a query to find out month between two dates ie between max(date) and min(date)
Mobile no can repeate suppose 2011-jan-01 to 2016-01-31
the mobile no '9999111123' occur 9 times ,'9999211123' occur 6 times
then find out months difference
select distinct mobile,max(apptdate),min(apptdate),count(mobile) as [count]
from crm_leadtable
group by mobile
having count(mobile) >7
order by count desc