Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8450111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:53:02+00:00 2026-06-10T10:53:02+00:00

Say i have this table: +—-+——+———————+————————-+ | id | user | timestamp | referrer

  • 0

Say i have this table:

+----+------+---------------------+-------------------------+
| id | user | timestamp           | referrer                |
+----+------+---------------------+-------------------------+
| 1  | foo  | 2012-08-26 14:05:55 | http://fubar.com/online |
+----+------+---------------------+-------------------------+
| 2  | foo  | 2012-08-26 14:05:59 | http://fubar.com/chat   |
+----+------+---------------------+-------------------------+
| 3  | bar  | 2012-08-27 07:06:07 | http://fubar.com/chat   |
+----+------+---------------------+-------------------------+
| 4  | max  | 2012-08-28 14:08:12 | http://fubar.com/chat   |
+----+------+---------------------+-------------------------+
| 5  | max  | 2012-08-28 14:08:36 | http://fubar.com/online |
+----+------+---------------------+-------------------------+

i want to select all users who has both more than 1 referrer and timestamps are the same up to the minute precision

this would mean that during a span of 1 minute, they were viewing 2 pages of the same site and thus could imply that they are multi-tabbing. so in the table above, foo and max would fit the criteria.

i want to know how i can achieve this in mysql.

thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T10:53:03+00:00Added an answer on June 10, 2026 at 10:53 am

    Make a self-join and use TIMESTAMPDIFF() in the join cirteria:

    SELECT DISTINCT a.user
    FROM   my_table a JOIN my_table b ON
           a.user     =  b.user
       AND a.id       <  b.id
       AND a.referrer <> b.referrer
       AND ABS(TIMESTAMPDIFF(SECOND, a.timestamp, b.timestamp)) <= 60
    

    See it on sqlfiddle.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I have a table Foo . This table has the columns ID
Lets Say i have a table like this WEB_LIST_TABLE KEY Value ---------------------------------------- 134 google.com
lets say i have this table user|group|acceptance 1 | a | -1 2 |
I've noticed something odd about user-defined variables: Lets say I have this table: num_table
Say I have this table schema. ID AccNo Amount Say I have this data
I have this table: id feed_id ... Let's say that I have 500 rows
Lets say I have one table called REVIEWS This table has Reviews that customers
I'm trying to format a table from XML. Lets say I have this line
Let's say I have a MySQL table that is something like this: software table:
I have this problem where after a field (say Field3 in table MyTable) is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.