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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T22:27:33+00:00 2026-05-25T22:27:33+00:00

Basically I have the following query: SELECT DISTINCT users.ID, users.name FROM users INNER JOIN

  • 0

Basically I have the following query:

SELECT DISTINCT users.ID, users.name
FROM users 
INNER JOIN usersSkills ON users.ID = usersSkills.userID 
INNER JOIN usersLanguages ON users.ID = usersLanguages.userID 
WHERE activated = "1" 
AND type = "GRADUATE" 
AND usersSkills.skillID IN(2, 21)
AND usersLanguages.languageID IN(2, 22)

I need to match the skillID and languageID to each parameter passed in the IN() function at the moment on each of those it will serve up a result if either parameter is found.

So essentially i want to only see results if the skill ID of 2 AND 21 are found on the skills table and the same idea for the languages…

  • 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-25T22:27:34+00:00Added an answer on May 25, 2026 at 10:27 pm

    Use a GROUP BY (this will also eliminate the need for SELECT DISTINCT) to get an aggregate count and a HAVING clause to make sure the count of distinct elements returned matches the number of elements you’re searching for.

    SELECT users.ID, users.name
    FROM users 
    INNER JOIN usersSkills ON users.ID = usersSkills.userID 
    INNER JOIN usersLanguages ON users.ID = usersLanguages.userID 
    WHERE activated = "1" 
    AND type = "GRADUATE" 
    AND usersSkills.skillID IN(2, 21)
    AND usersLanguages.languageID IN(2, 22)
    GROUP BY users.ID, users.name
    HAVING COUNT(DISTINCT usersSkills.skillID) = 2
       AND COUNT(DISTINCT usersLanguages.languageID) = 2
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a following SQL QUERY: SELECT articles.name, articles.price, users.zipcode FROM articles INNER JOIN
I have the following query: SELECT ,e.EmployeeCode ,c.CompanyName ,v.Violation FROM dbo.Employee e INNER JOIN
Basically, I have the following query: SELECT sr.name AS salesrepname, ct.name AS customertypename, c.name
I have the following query: SELECT dm.app_id, apt.app_name, COUNT(dm.app_id) FROM dm_openapp dm JOIN app_table
I have the following query: SELECT DISTINCT sites.site_id, sites.site_name, sites.site_url, earnings.cust_id FROM sites, earnings
I have the following query: $result = $mysqli->query('SELECT DISTINCT SKU_SIZE_PART1 FROM SKU_DATA WHERE SKU_BRANDNAME
I have following MySQL query: (SELECT c.Channel as name, count(*) as total_episode FROM (
Basically I have a mysql query something like the following: mysql_query(SELECT n.title, v.value FROM
I have the following MySQL query: SELECT Project.*, `trk_deleted`, `trk_status`, `trk_state` FROM `project` AS
I'm having trouble with the following query: SELECT costingjobtimes.TimeStamp, costingdepartment.DeptDesc, costingemployee.Name, costingjobtimes.TimeElapsed FROM costingemployee

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.