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

The Archive Base Latest Questions

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

I have a table form ( int id ) webformsystemflags ( int id, int

  • 0

I have a table

form (
int id )
webformsystemflags ( int id, int formid int sysflagid )

sysflag ( int id, name char(10) )

form table is a table which has all the forms

webform is a table which has the forms which have flags applied to it. It has a foreign key formid which is id to the form table and sysflagid which is foreign key to the sys flag table

sys flag is the table which contains the flags. Lets say I have flags defined as 1,2,3
I can have forms which don’t have all the flags applied to it, some may have 1, some may have 2 or some may have 3 applied to it or some may have none.

How can I find all the forms which have either flag 1 or flag 2 or flag 3 applied to it ?

  • 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-27T11:03:53+00:00Added an answer on May 27, 2026 at 11:03 am

    This is a common trick to find EXCLUSION. The value I have below of “FlagYouAreExpectingTo_NOT_Exist” is explicitly the one you expect NOT to be there. Here’s how it works.

    Get every form and LEFT JOIN to the Web System Flags table WITH FINDING the matching form, and flag setting you DO NOT want. If it finds a valid entry for the form and flag, the “formid” in the (wsf) table will exist. So, we want all that DON’T exist, hence the closing WHERE wsf.formid is null.

    It will be NULL for those where it is NOT already flagged.

    select
          f.ID
       from
          forms f
             left join webformsystemflags wsf
                on  f.id = wsf.formid
               AND wsf.sysflagid = FlagYouAreExpectingTo__NOT__Exist
       where
          wsf.formid is null
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table that has records in the form(simplified): ID (int), startTime(DateTime), endTime(DateTime)
I have a table name Discount that has the following schema: PK DiscountID int
I have a table of the form CREATE TABLE data { pk INT PRIMARY
I have 2 tables which in simplified form look like this: Products( id: int,
I have a form that searches all rows in a single table (TServices) that
I have a table where a plugin keeps all form submissions, in this table
I have a form(table view) which contains textfields and textview as subviews,I need to
I have an HTML table where each row has buttons which toggle status bits
I have a table (in a form) populated with radio buttons (with a button
I have a table for a contact form and this table contains another table

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.