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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T23:43:45+00:00 2026-06-04T23:43:45+00:00

Given the following table: InstalledApps MachineName | AppName | Version ——————————- machine01 | App01

  • 0

Given the following table:

InstalledApps

MachineName | AppName | Version
-------------------------------
machine01   | App01   | 1.1
machine01   | App02   | 1.0
machine01   | App03   | 1.5
machine02   | App04   | 2.0
machine02   | App02   | 1.0
machine02   | App01   | 1.1
machine03   | App06   | 7.9.9
machine03   | App01   | 1.1
machine03   | App07   | 11.5
machine03   | App02   | 1.0

I need to select Apps which are common to given “n” machines. It’s an intersect between “n” sets. However, I’m having a hard time coming up with a decent query.

I know that I can do something like this:

SELECT AppName, Version 
FROM InstalledApps 
WHERE MachineName = 'machine01'

INTERSECT

SELECT AppName, Version 
FROM InstalledApps 
WHERE MachineName = 'machine02' 

That will give me

AppName | Version
------------------
App01   | 1.1
App02   | 1.0

However, is there a way I can do it without having to know the number of machines upfront? Something like

SELECT...... 
FROM InstalledApps 
WHERE MachineName IN ('machine01',...'machine99')
  • 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-04T23:43:46+00:00Added an answer on June 4, 2026 at 11:43 pm

    I think this should do it for the general case:

    SELECT AppName, Version, COUNT(DISTINCT(MachineName)) AS MachineCount
    FROM InstalledApps
    GROUP BY
      AppName, Version
    HAVING
      COUNT(DISTINCT(MachineName)) > 1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given the following data table definitions in SQLite Version 3.7.5: CREATE TABLE [Books] (
Given the following table: id category_id categorizable_id categorizable_type 66 22 67 Image 72 22
Given the following table PAYMENT_Date TRANSACTION_TYPE PAYMENT_AMT 1/1/2012 P 184366 1/1/2012 R -5841 1/2/2012
Given the following html table and script shown below I am having a problem
Given the following data/schema: DECLARE @t1 TABLE ( Id int NOT NULL ) DECLARE
Given the following situation: @Entity @Inheritance(strategy = InheritanceType.JOINED) @Table(name=TOP_TABLE) public class BaseClass implements Serializable
Given a table of the following form CustumerID | Amount ------------------- 1 | 100
Given a simple table with the following data: id | result | played ----+--------+------------
Given a table (id, col1, col2), does it make sense to create the following
I have a necessity to sort a given HTML table of the following structure,

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.