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

The Archive Base Latest Questions

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

I am trying to run a query to return the customer first and last

  • 0

I am trying to run a query to return the customer first and last name only if the IP address they have used for a session is different.

for example:

Customer 1 makes Order on Session IP address: 192.168.12.1
Customer 1 makes Order on Session IP address: 192.168.12.2

Customer 2 makes Order on Session IP address: 192.168.12.3
Customer 2 makes Order on Session IP address: 192.168.12.3

Return Customer where IP address is not same (Customer 1)

However, I can’t work out how to specify the difference in the IP address.

What I currently have is:

Select Cust_First, Cust_Last
FROM customer

LEFT join Session
On customer.cust_ID = session.Cust_ID

LEFT join Order
On session.Ses_ID = order.Session_ID

Where Ses_IPAddress # Is different for the same customer? 

I’ll detail the tables with the necessary fields:

Customer:
PK: Cust_ID
row: Cust_First
row: Cust_Last

Session:
PK: Ses_ID
FK: Cust_ID
Row: Ses_IPAddress

Order:
PK: Order_ID
FK Ses_ID
  • 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-14T05:29:13+00:00Added an answer on June 14, 2026 at 5:29 am

    Actually the task is way easier than the way you are trying to complete it. Just select these customers from the ones that do fit your logic.

    SELECT Cust_First, Cust_Last
    FROM Customer
    WHERE Cust_ID IN (
        SELECT Cust_ID
        FROM Session
        JOIN Order On Session.Ses_ID = Order.Ses_ID
        GROUP BY Cust_ID, Session.Ses_IPAddress 
        HAVING COUNT(1) > 1
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables from which I'm trying to run a query to return
In Wordpress, I'm trying to run a query to return a postID where it
I'm trying to run an LDAP query which will return all users which belong
I am trying to run a simple FQL query: SELECT aid,name FROM album WHERE
I am trying to run a query where I get the name of locations
I have this public DataTable that I am trying to run an sql query
I'm trying to run a query on DBPedia.org via SPARQL. Basically, here's what I
Hi I am trying to run this query in SQL but it is not
Hi i am trying to run a query on a database, but i keep
Hey guys I am getting this exception when trying to run the query Column

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.