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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T00:13:18+00:00 2026-06-18T00:13:18+00:00

I have two tables table-a id name 100 asd 101 ass 102 gdd 103

  • 0

I have two tables
table-a

id   name
100    asd
101    ass
102    gdd
103    hgf
104    cvd
105    erf

table-b

id     filter
100     red
101     blue
100     green
100     yellow
102     black
102     red
103     dark

Table-a is the master table and that have all the id’s.but Table two is the one which has ‘filter’ data.
from these two table I want to find out all those ‘id’s which does not have minimum 2 filters.
note that table-b does not have all the itemnumbers in table-a, and i want all that itemnumber irrespective of if that is in table-a or table-b.I have tried inner joining these two tables and getting data out but nothing worked.

  • 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-06-18T00:13:20+00:00Added an answer on June 18, 2026 at 12:13 am
    Select A.ID, A.Name, count(*)
    from tableA A
    LEFT JOIN tableB B on A.ID = B.ID
    Group By A.ID, A.name
    having count(*) <= 1
    
    • LEFT JOIN gives all records from A and only those in B which match.
    • The group by ID and name let us count the number of filters found in
      each
    • The having says give me any items with a count less than or
      equal to 1. (or less than the minimum 2)

      Thus results would be.

      101 ass 1
      103 hgf 1
      104 cvd 0 
      105 erf 0
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two tables: <h3>JVM Garbage Collector</h3> <table style=width:100% border=1> <tr><th>Name</th><th>Description</th><th>Type</th><th>Key</th></tr> <tr> <td style=width:25%>PS
I have two tables: Table items: | id | name | description | |
I have two tables one with ID and NAME table 1 ID | NAME
I have two tables user table user_id | name | 1 | peter |
Quick method description: I have two tables, lets name them table ONE and table
I have the following two tables in my mysql database. Table Name: groups id
I have two tables, for example: Table A Table B ======= ======= Name |
I have Two tables. 1.Users table (Username , Name) 2.Picture table( ID , Username
I have two tables: Folder, Files. Each table has 4 fields: ParentID, ID, Name,
i have the following two tables:- GeoShapes GeoShapeId INT IDENTITY Name VARCHAR(100) ShapeFile GEOGRAPHY

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.