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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:06:14+00:00 2026-06-15T09:06:14+00:00

I have a database of orders that looks roughly like this ORDER ID |

  • 0

I have a database of orders that looks roughly like this

   ORDER ID | AMOUNT | FIRSTNAME | LASTNAME
     1         50        JOHN       SMITH
     2         60        PAUL       JOHNSON
     3         20        FRANK      CAMERON
     5         80        JOHN       JOHNSON

I have a list of names that I need to pull their orders. For this example lets say “JOHN SMITH” and “PAUL JOHNSON”

I have tried a query like this

SELECT * FROM ORDERS WHERE FIRSTNAME IN ("JOHN", "PAUL") AND LASTNAME IN ("SMITH", "JOHNSON")

But obviously that didn’t work how I wanted as it included. I’m not sure how to go about it but I need to search something like

WHERE FIRSTNAME,LASTNAME IN ("JOHN","SMITH";"PAUL","JOHNSON")

OR

WHERE (FIRSTNAME,LASTNAME) IN {("JOHN","SMITH")("PAUL","JOHNSON")}

Obviously I know little about SQL so I’m getting stuck on syntax and terminology of what to search for?

  • 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-15T09:06:15+00:00Added an answer on June 15, 2026 at 9:06 am

    You can separate the logic with an OR like this:

    SELECT * FROM ORDERS
    WHERE 
    (FIRSTNAME = "JOHN" AND LASTNAME = "SMITH")
    OR
    (FIRSTNAME = "PAUL" AND LASTNAME = "JOHNSON")
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a database full of users that roughly looks like this: | id
I have a database that essentially looks like this: id uniqueidentifier NOT NULL data
I have a save function for my order entity that looks like this and
I have a MySQL Database That Looks like This: Name: Joe Items: 25 CreationDate:
I have a table that looks something like this: CREATE TABLE student_results(id integer, name
I have a table of results that looks like this: score_id, uid, af_id, level,
So I have a dictionary that looks like this when I print it: {'10':
I am working with a legacy database schema that looks like this: product_table table
I have a table in my SQL database that looks like: id type radius
I've got a database that looks like this: ID Name ParentID 1 1 0

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.