I have the following query, the AND state = 1 is being ignored, i get all the states instead of only what is equal to 1. Where is my mistake here?
$query = "
SELECT state, id, variable, name, {$columns->specific}, {$columns->allExcept}, {$columns->specificExclude}, {$columns->relationAllExcept}, repeatable
FROM #__epc_fieldsgroups
WHERE FIND_IN_SET({$relationRecordId}, {$columns->specific})
OR {$columns->allExcept} != 0
AND FIND_IN_SET({$relationRecordId}, {$columns->allExcept}) = 0
AND state = 1
ORDER BY ordering
";