sql - Get the visitors that have only revisited one day or more -


i have sql query visitors have been online more once since first visit:

select count(date_lastactive) visitors date_lastactive != '0000-00-00 00:00:00' 

because of simpleness, every revisited visitors listed. don't want that! want visitors have been revisited website 1 day , more (2 days, 3 days, 5 month, 8 months, 2 years, , on not under 1 day such 4 hours or that).

how can accomplish this?

thanks in advance :)

t-sql (ms sql server syntax):

select count(some_visitor_id) visitors datediff(d, date_lastactive, date_firstvisit) > 1 

not 100% sql dialect freshprinceofso using, guess it'll this:

select count(some_visitor_id) visitors date_lastactive >= date_add(date_firstvisit, interval 1 day)` 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -