Very simple, but I donβt know how this type of query is called ... I want a query that will basically do this (pseudo-SQL):
SELECT name
FROM Table
WHERE activity_status != 'active'
AND there are no rows with that same name where activity_status = 'active'
(in other words, return inactive names only if not one with this name is active)
This will be used to allow users to activate inactive elements, but I want to query db to make sure the element is not active yet.
source
share