Jump to content

Advance "distinct"


khadem1386

Recommended Posts

Himy Table has about 1,000,000 Records that saved During 20 daysThese are my fields . that save Ip Of my visitor. ID , Date_server , IP"Date_server" is Date-time DATA TYPE Now I want count number of my visitors.so this is my query to count my VISITORs on '3-10-2011'.

SELECT   COUNT(distinct ip) AS [Number of visitors]FROM Table1where CONVERT(VARCHAR(10),(Date_server), 105) =   '3-10-2011'

It return 5700 Then I check by some another counters.They return 7600 After it I see that problem is "VISITOR" 's Meaning. this is my new rule-When an Ip(visitor) leave my site for more than 30 minutes. then he return to site , He is a new visitor.-But if he has not a gap large than 30 minutes. he is not a new visitor for my counter. What query you offer for me, instead "Distinct"?or is there any advance "Distinct"?or can we use advance "Where" or sub-query ? I need your code sample pleaseThanks for your time

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...