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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:36:58+00:00 2026-05-28T02:36:58+00:00

I have one table that holds my ressources: Ressource | Ressource-ID And a table

  • 0

I have one table that holds my ressources:

Ressource | Ressource-ID

And a table that holds the associations

Ressource-ID | Employee-ID

How to select the ressources of an Employee that are available, i.e. not in the association table?

I’ve tried this, but it’s not working:

select r.ress, r.ress_id
FROM Ressource r
LEFT outer JOIN Ressource_Employee_Association a ON r.ress_id = a.ress_id
WHERE a.emp_id = 'ID00163efea66b' and a.ress_id IS NULL

Any ideas?

Thanks
Thomas

  • 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-28T02:36:59+00:00Added an answer on May 28, 2026 at 2:36 am

    After writing my above comments, and looking at the proposed solutions: I think I’ve got some more understanding of what you are trying to do.

    Assuming you have unlimited quantity of resources in your resources table, you want to select the un-assigned resources per employee (based on their non-existence for any specific employee in the resource association table).

    In order to accomplish this (and get a comprehensive list of employees) you’ll need a 3rd table, in order to reference the complete list of employees. You’ll also need to CROSS JOIN all of the resources onto the list of employees (assuming every employee has access to every resource), then you LEFT JOIN (LEFT OUTER JOIN whatever) your association list onto the query where the resource_id and employee_id match the resource_id in the resources table, and the employee_id in the employees table (respectively). THEN you add your where clause that filters out all the records that assign an employee to a resource. This leaves you with the resources that are available to the employee, which they also do not have signed out. This is convoluted to say, so hopefully the query sheds more light:

    SELECT e.employee_id, e.employee, r.res_id, r.res
    
    FROM employees e
    CROSS JOIN resources r
    LEFT JOIN assigned_resources ar
        ON ar.employee_id = e.employee_id AND r.res_id = ar.res_id
    
    WHERE ar.res_id IS NULL
    

    If you don’t have an employees table, you can accomplish the same by using the assigned resources table, but you will be limited to selecting employees who already have some resources allocated. You’ll need to add a GROUP BY query because of the possible existence of multiple employee definitions in the association table. Here’s what that query would look like:

    SELECT e.employee_id, r.res_id, r.res
    
    FROM assigned_resources e
    CROSS JOIN resources r
    LEFT JOIN assigned_resources ar
        ON ar.employee_id = e.employee_id AND r.res_id = ar.res_id
    
    WHERE ar.res_id IS NULL
    
    GROUP BY e.employee_id, r.res_id
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Given that I have a table that holds vehicle information and one of those
Lets say I have one table called REVIEWS This table has Reviews that customers
I have a database table that holds information for received files. One of the
I have a table that holds clients, I have just one client per country,
Suppose i have one table that holds Blogs. The schema looks like : ID
I have an SQLite DB with one table that holds IDs for several strings,
I have one table that has sales records and another table that has additional
Here is my situation: I have one table that contains a list of drugs
I have one table view that should be filtered by values of search field
I have one table, e.g. pricerules, that have stored special prices by article for

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.