I have a table named 'resources'
Machine Host Enabled
mach1 host1 TRUE
mach2 host1 FALSE
mach3 host1 FALSE
mach4 host2 TRUE
mach5 host2 TRUE
I want to get the list of hosts where Enabled is True for all the resources/machines associated with them.
I tried the sql query-
select distinct Host from resources where Enabled = TRUE;
But that query gives me back both host1 and host2 as the answer whereas I am expecting the answer to be just host2. Can anyone help me with a sql query which can achieve this ?