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

  • Home
  • SEARCH
  • 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 1008137
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:43:31+00:00 2026-05-16T08:43:31+00:00

I need a query for the following problem. Table1 specifies the mandatory input fields.

  • 0

I need a query for the following problem. Table1 specifies the mandatory input fields. I will fetch the fields with inactive = ‘No’ and mandt field = ‘yes’

So i have 4 records with fields as sev,sev1,cde,frt.

Table1:

Fields                 Inactive              mandt_field

sev                     no                      yes
sev1                    no                      yes
sev2                    yes                     yes
abd                     no                       no
cde                     no                      yes
frt                     no                      yes

Table 2 has data similar to this

concession           add_fields

TH-123               -sev*yes-sev1*no-sev2*yes
Th-234               -sev*yes-sev1*yes-cde*yes-frt*no
Th-345               -sev*yes-cde*yes-frt*no
TH-456               -cde*no-frt*no
Th-012               -sev*no-sev1*no-cde*no-frt*no
Th-451               -frt*yes
TH-900               -sev2*no

Now i need records which does not have the above 4 fields in add_fields.
output should return the following records :- TH-123,Th-345,TH-456,Th-451,TH-900.

These 4 records does not have all 4 fields that we have retrieved from the previous table (sev,sev1,cde,frt).

The no. of the fields resulting from table1 may vary..As these are from a table data…so we may have (sev,sev1,cde,frt….)

  • 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-16T08:43:32+00:00Added an answer on May 16, 2026 at 8:43 am

    To answer your original question

    SELECT DISTINCT concession
    FROM Table2
    INNER JOIN Table1 ON Table2.add_fields NOT LIKE '%-' + Table1.Fields + '*%'
    WHERE Inactive='no' AND mandt_field='yes'
    

    Following on from the comments though add_fields seems to contain a list of items. That in turn contains pairs of codes and yes/no values. I suggest restructuring your table2 as follows. This will put it into first normal form.

    Putting it into first normal form will make updates, and searches easier without having to parse every string each time to break it into its constituent items. It will also allow you to apply integrity constraints to your data.

    concession    code    YesNo
    ----------------------------
    TH-123        sev       yes
    TH-123        sev1      no
    TH-123        sev2      yes
    Th-234        sev       yes
    ....
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to write the following query so the att field is always a
I'm having a problem with a MySQL query. I need to display the following
I need a query which can do the following operation. I have a table
we need to implement the following query in such a way that we should
I need a query to perform the following: find the countryID where country =
I need to achieve the following query - tags is an internal array in
i have the following query to list the employees of two table. i need
I have the following query. It works just fine but I need to pull
I'm trying to write a Linq2XML query to query the following XML. I need
I need an sql query to give me the following: All the values in

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.