Help with Query - Access

Posted by yae on Stack Overflow See other posts from Stack Overflow or by yae
Published on 2010-03-08T10:21:30Z Indexed on 2010/03/08 10:36 UTC
Read the original article Hit count: 248

Filed under:
|

Hi

I have 4 tables: machines, categories, users and usersMAchines

machines is linked to categories and usersMachines.

Machines
--------
idMachine 
machine
idCat

Categories
--------
idCat
category

Users 
--------   
idUser
nameUser

UsersMachines
--------
idUserMachine
idUser
IdMachine

To list machines, filtered for any field of 3 previous table, I have this query:

select distinct machines.*,categories.category  from( (machines left join  UsersMachines on machines.idMachine=UsersMachines.idMachine) left join categories on machines.idcat=categories.idcat)

Ok,runs fine.

But Using the same query, how I can do to filter the machines that only have linked users ?

© Stack Overflow or respective owner

Related posts about ms-access

Related posts about query