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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:23:03+00:00 2026-05-27T21:23:03+00:00

To filter a table output of selected entries from a single table i would

  • 0

To filter a table output of selected entries from a single table i would need something like a multiple JOIN request through several tables.
I want to filter a table of people by a special column in the table. Lets say this column is “tasks.” Now tasks is also another table with the column “people” and the values between those two tables are connected with an existant “join” table in the database, which is matching several IDs of one table to each ID of the other table.
Now if this would be simple as that i could just filter with an INNER JOIN and a special condition. The problem is, that the entries of the table “tasks” are connected to another table over a “join” table in the database. To simplify things lets say it is “settings”. So each “task” consists of several “settings” which are connected via a join table in their IDs.

So what is the input?
I got an array of IDs, which are representing the settings-ids i do not want to be shown.

What should be the output?
As already said i want a filtered output of “people” while the filter is “settings.”
I want the sql request to return each entry of the table “people” with only joined tasks that are not joining any of the “setting-ids” from the array.

I hope you can help me with that.

Thanks in advance!

Example

Settings-Table:
1. Is in progress
2. Is important
3. Has unsolved issues

Tasks-Table: (settings.tasks is the join table between many tasks to many settings)
1. Task from 01.01.2012 – JOINS Settings in 1 and 3 (In progress + unsolved issues)
2. Task from 02.01.2012 – JOINS Settings in 2 (Is important)
3. Task from 03.01.2012 – JOINS Settings in 1 and 2 (…)

People-Table: (people.tasks is the join table between many people to many tasks)
1. Guy – JOINS Tasks in 1, 2, 3 (Has been assigned to all 3 tasks)
2. Dude – JOINS Tasks in 1 (Has been assigned to the Task from 01.01.2012)
3. Girl – JOINS Tasks in 2, 3 (…)

Now there is an array passed to a sql query
[2,3] should return noone because every person is assigned in a task that was either important or had unsolved issues!
[3] would return me only the person “Girl” because it is the only one that is assigned to tasks (2 and 3) that had no unsolved issues.

I hope it is clear now. 🙂

  • 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-27T21:23:04+00:00Added an answer on May 27, 2026 at 9:23 pm
    SELECT DISTINCT PEOPLE.* 
    FROM PEOPLE INNER JOIN PEOPLE_TASKS ON PEOPLE.PERSON_ID = PEOPLE_TASKS.PERSON_ID
    WHERE TASK_ID NOT IN (SELECT DISTINCT TASK_ID
                          FROM TASK_SETTINGS
                          WHERE SETTING_ID = <Id you don't want>)
    

    EDIT (for supplying multiple setting ids you don’t want)

    SELECT DISTINCT PEOPLE.* 
    FROM PEOPLE INNER JOIN PEOPLE_TASKS ON PEOPLE.PERSON_ID = PEOPLE_TASKS.PERSON_ID
    WHERE TASK_ID NOT IN (SELECT DISTINCT TASK_ID
                          FROM TASK_SETTINGS
                          WHERE SETTING_ID IN (<Id you don't want>))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to filter a table from an alphabetical <select> input with jQuery. I
I need to filter out junk data in SQL (SQL Server 2008) table. I
I need to write a table-valued function in T-SQL that would take a zip
I'm having a table with one XML column. I'd like to filter out the
I need to gather Distinct Id's from a particular table using LINQ. The catch
I am trying to filter table results from Table B by clicking on a
I'm new to Doctrine and ActiveRecord. How should I filter a table after it
I have a table with say 1640 items. I set bindingSource.Filter = some filter
How to filter DataView/DataTable by time? I have a table with datetime column inside
Is the route table available from the filters? I'm inheriting from the AuthorizeAtrribute class.

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.