I have 3 table in my PostgreSQL database:
menu(id_menu,parent_id,name_uri,uri)
type_role(id_role,name_role)
menutyperole(id_menu,id_role)
In my table type_role
I have the following data (administrator and technician), in the table menu
exist has many link multi-level to access a other sides, and the table menutyperole
is a connection with the other tables. I need a query to extract the data of menu
where no technician is assigned (type_role
table). I don’t know if I need any condition or anything else?
SELECT *
FROM menutyperole
INNER JOIN type_role ON menutyperole.id_role = type_role.id_role
RIGHT JOIN menu ON menu.id_menu = menutyperole.id_menu
WHERE menu.id_parent != 0