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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:38:46+00:00 2026-05-13T10:38:46+00:00

I have four MYSQL 5.0 tables: userdb, filterdb, filterlinkdb, mandatoryfilterdb. All tables are simple.

  • 0

I have four MYSQL 5.0 tables: userdb, filterdb, filterlinkdb, mandatoryfilterdb.

All tables are simple. * = pri

userdb:
 id*
 name

filterdb:
 id*
 name

filterlinkdb:
 user_id*
 filter_id*

mandatoryfilterdb
 filter_id*

How can I check filterlinkdb to make sure that all mandatoryfilterdb records exist for every user_id using a single (with or without subs) query?

Edit :: I forgot to say, I would like to return the filter_id values from mandatorydb that are not present in filterlinkdb for all user_id, eg: user #1 only has filter 1, but 1 and 2 are in the mandatorydb, so it would return user 1, filter 2 (as that is missing).

  • 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-13T10:38:46+00:00Added an answer on May 13, 2026 at 10:38 am

    That should work:

    select userdb.id,mandatoryfilterdb.filter_id
    from userdb 
      join mandatryfilterdb 
      on 1
        left join filterlinkdb
        on userdb.id=filterlinkdb.user_id 
          and mandatryfilterdb.filter_id=filterlinkdb.filter_id 
    where filterlinkdb.user_id is null
    

    It selects all the cartesian multiple between users and mandatory-filters, and check them against the true filterlinkdb table. If they aren’t there (filterlinkdb.user_id is null, you can check the filter_id instead, it’s the same) – than give them in the result of the query.

    If none record returned – you are consistent.

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

Sidebar

Related Questions

I have four tables: characters arena_team arena_table_member arena_team_stats. characters table has guid, name arena_team
I have four tables containing exactly the same columns, and want to create a
I have four flags Current = 0x1 Past = 0x2 Future = 0x4 All
Let's say I have four tables: PAGE , USER , TAG , and PAGE-TAG
I have four tables I want to join and get data from. The tables
I have to JOIN to large tables in a MySQL query and it takes
I have three tables, table one (tableA) containing users data like name and email,
I have four tables: RootNode // Will return multiple root nodes SubNode // Will
I have some databases that have four files each; one for PRIMARY, IDX, IMAGE,
Scenario: Let's say I have four very similar applications (i.e. most of the functionality

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.