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

The Archive Base Latest Questions

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

I have 3 tables. An Applications (relevant field is AppID) table containing information about

  • 0

I have 3 tables. An Applications (relevant field is AppID) table containing information about various application available to download, a Packages table (relevant field is PackageID) containg information on the various downloadable items available and an App/Packages table (relevant field is AppID and PackageID) which shows which packages should be downloaded for each application. I need a query to find out which packages are not related to a specific application.

My idea was to INNER JOIN Applications to AppPackages to get a list of all the packages that are related to an Application and then OUTER JOIN this resultant set to Packages and find all the null results to show which packages were not related.

The problem is I can’t seem to work out how to chain these queries. Subqueries don’t seem to work, and EXIST/NOT EXIST requires information from the outer query which I just can’t make work. I’m assuming there’s something simple I’m mising, but all the literature I read is for two tables, never more than two.

This is my best attempt, but the EXISTS part doesn’t work for the reason mentioned above.

SELECT Packages.PackageID FROM Packages WHERE NOT EXISTS
(Select AppPackages.PackageID, AppPackages.AppID FROM AppPackages WHERE AppPackages.AppID = @AppID)

Thanks in advance for any help 🙂

Cheers,

Matt 🙂

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

    I need a query to find out which packages are not related to a specific application.

    SELECT
      *
    FROM
      Packages p
    WHERE
      NOT EXISTS (
        SELECT 1 
          FROM Applications a 
               INNER JOIN AppPackages ap ON ap.PackageId = p.PackageId
         WHERE ap.AppId = <Your App ID>
      )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have two tables in our application that both have a ShowOrder column. We
I have a delete statement that's going against one of my core application tables.
I have a Client/Server application, where the Client and Server have some common tables
in my application I have a few CListCtrl tables. I fill/refresh them with data
I have property management application consisting of tables: tenants landlords units properties vendors-contacts Basically
I have an application and I want to move some of the tables from
Many applications have grids that display data from a database table one page at
In one of my applications I have a 1gb database table that is used
I'm looking at building a Rails application which will have some pretty large tables
I have a table like this: Application,Program,UsedObject It can have data like this: A,P1,ZZ

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.