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 8616195
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T05:33:36+00:00 2026-06-12T05:33:36+00:00

I have a statistics database for people who have visited. This table contains ID,

  • 0

I have a statistics database for people who have visited. This table contains ID, timestamp IPv4, IPv6, User Agent and REQUEST_URI. I get false numbers by running something like

SELECT COUNT(DISTINCT IPv4) AS 'Uniques', COUNT(*) AS 'Total' FROM statistics

So I need to filter out the bots from humans. My approach is this:

SELECT ID FROM statistics WHERE NOT EXISTS(SELECT ID FROM statistics WHERE useragent NOT LIKE '%bot%')

This should select all rows from statistics which are not present in the query which searches for non-bots. I think the query looks reasonable so why isn’t it working?

And there is a reason I want to do it this way instead of

SELECT ID FROM statistics WHERE useragent LIKE '%bot%'

Any ideas?

  • 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-12T05:33:37+00:00Added an answer on June 12, 2026 at 5:33 am

    I’m a bit confused, but maybe you want to do:

    SELECT ID FROM statistics 
    WHERE ID NOT IN (SELECT ID FROM statistics WHERE useragent NOT LIKE '%bot%')
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a production database where usage statistics reside. This database is responsible for
I have the following database table with information about people, diseases, and drugs: PERSON_T
We have a CMS plugin that writes statistics to 1 table, this creates performance
I have a MySQL table to store user statistics with >2MM rows and 8
We have a database that contains xml fields. At this moment we perform queries
I have a table with statistics and a field named time with Unix Timestamps.
I have table where I track various statistics about site usage. Once a week,
I have a page that shows statistics for users, this cannot be cached because
I have an application which records statistics. When a user submits their statistics the
In my database running on SQL Server 2008 R2 I have a special table

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.