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

  • Home
  • SEARCH
  • 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 8201249
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T06:44:39+00:00 2026-06-07T06:44:39+00:00

My goal is simple: JOIN by IP addresses from different logs; at the client-side

  • 0

My goal is simple: JOIN by IP addresses from different logs; at the client-side I’m trying to determine where JavaScript errors are being spawned from (e.g. humans or bots) which I am inferring from if a isset($row[date_xy]) via PHP.

This query does work fine without ORDER BY, once I throw that in to the mix MySQL jumps to 30% CPU utilization and stays there for a few seconds before I kill the process. I’m testing this locally of course. I want to use ORDER BY je.date DESC as I’m not interested in the oldest possible entries.

I have tried sub-selects, it’s been a while since I’ve done anything fancier than a basic JOIN. It’s important that I keep the syntax SOL-neutral.

SELECT 
je.date AS date_js, 
lb.date AS date_lb, 
lh.date AS date_lh 

FROM log_javascript_errors AS je 

LEFT JOIN log_bots AS lb ON je.ip = lb.ip 

LEFT JOIN log_humans AS lh ON je.ip = lh.ip 

ORDER BY je.date DESC 

LIMIT 20, 20
  • 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-07T06:44:41+00:00Added an answer on June 7, 2026 at 6:44 am

    I’ve gone a different route as I must admit this the design of the tables did not consider this possibility when I created them originally; we’ve all encountered this. I did learn SQL vendor-neutral CASE syntax however though found out I did not even need to use that after some modifications so I’m up-voting the two replies I received as thanks for expanding my understanding of SQL. For those who find this question directly relevant to their goals I ended up adding a “type” column which I am using the server scripting language to fill in the rest in order to generate what I need to see in my logs. I think if I redesigned it from scratch I would have created a master sessions table for all “types” (humans, search engines and rejects) and then possibly try a double LEFT JOIN though I’m not sure how well that would work offhand.

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

Sidebar

Related Questions

I am trying to achieve a very simple goal, however it does not seem
I'm trying to run exec-maven-plugin 's exec:java goal on a simple two-module project where
Trying to get a simple COUNT from a table that takes a couple of
my simple goal is following: i would get the news feed from a facebook
My goal is to recognize simple gestures from accelerometers mounted on a sun spot.
Our goal is simple for an iPhone app: show a splash page then hide
I think I have a pretty simple goal but cant seem to reach it.
My goal is to build a simple custom guard with Guard . The gem
My goal is to deploy a simple rails application on a windows server using
In Google Analytics I set a Goal that is a simple URL Destination using

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.