I need to realize logic "All, except in list" with single query to show a widget on all routes, except listed. I have next query:
SELECT *
FROM widgets w0_
LEFT JOIN widget_route w1_
ON w0_.id = w1_.widget_id
LEFT JOIN routes r2_
ON w1_.route_id = r2_.id
WHERE r2_.id IS NULL OR w1_.id = 3
Where 3 is an ID of current route, that I have dynamically. But I need to except widget from routes, listed in widget_route
table
There is table structure:
widgets: id, name, published
widget_route: id, widget_id, route_id
routes: id, name, path
Can anybody help me?