[Solved] SQL: query contains at least one “true” value


You should show some effort and try to solve it yourself (it’s good for learning if for no other reason), but anyway, this can be done in several ways. This is two:

SELECT idt, nome, bool1 FROM path
WHERE idt IN (
  SELECT idt FROM path WHERE bool1 = 'true');

SELECT path.idt, nome, bool1 FROM path
INNER JOIN
  (SELECT DISTINCT idt FROM path WHERE bool1 = 'true') q ON path.idt = q.idt;

Sample SQL Fiddle

solved SQL: query contains at least one “true” value