Calculate the number of regular users in mysql -


given table showed in picture, want calculate number of users have dates far in more 1 day. problem calculate number of regular visitors.

table

for example: user adrian@ have 3 timestamps, 2 of them in same day , other 1 2 days after, user came back. instead, user david@ have 2 timestamps (in same day), means user didn't come back. ideas?

you can use following query:

select usuario_email users group usuario_email having count(distinct date(fecha)) > 1 

the above select users having visited site in 2 or more different dates, hence select adrian@ based on sample data.

demo here


Comments

Popular posts from this blog

OpenCV OpenCL: Convert Mat to Bitmap in JNI Layer for Android -

android - org.xmlpull.v1.XmlPullParserException: expected: START_TAG {http://schemas.xmlsoap.org/soap/envelope/}Envelope -

python - How to remove the Xframe Options header in django? -