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 ?