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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T11:01:53+00:00 2026-05-24T11:01:53+00:00

I am wanting to produce a query which allows me to select multiple records

  • 0

I am wanting to produce a query which allows me to select multiple records depending on the previous available records. Let me explain.

I have a table which holds 100 records with 3 different clients and region dependent. i.e.

Record 1 belongs to client 1 and appears in regions: 1, 2, 3
Record 2 belongs to client 1 and appears in regions: 1, 2
Record 3 belongs to client 2 and appears in regions: 1, 2
Record 4 belongs to client 3 and appears in regions: 2, 3

Now, if I enter region 1 as my option to search, I would see record 1, 2, 3. If I enter region 2 as my option I would like to see records 1, 2, 3 but not record 4 because I already have 2 other clients.

Now, if I enter region 3 as my option I would like to have returned record 1, 4.

I basically want to do a limit on the result but not on the amount of records returned, but on the different regions. So show all records that exist for the first 2 available regions.

Hope this can be done.

Cheers

  • 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-05-24T11:01:54+00:00Added an answer on May 24, 2026 at 11:01 am

    It would probably be simpler to do this as two queries:

    1. Select unique client ids within the region you’re looking at, and limit to the first N of them (where N is the most you want).
    2. Select all of the records with one of the selected client ids plus the desired region ID.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a client who is wanting to create a link which contains product
Just wondering if you could help wanting to produce an activity stream in Java,
i have done an Accordion style jQuery function which works lovely, but would like
Currently I have UNION's between 3 different select statements giving me three rows. What
I have the following 2 classes code that produce this result for instance: Wainting
I have a client wanting a 3rd party, lead gen popup script installed in
At work, we have a three-tier product. There is a client application which the
I have some Linq code and it's working fine. It's a query that has
I'm wanting to have a simple cancel button so on confirmation of, say, the
Wanting to implement authentication by client certificates I am experiencing some issues. First some

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.