Matthew Warren12/15/2022, 4:12 PM
to determine failure/pass respectively?
Michal Nicpon12/15/2022, 4:14 PM
in policy queries because we don’t care about the actual columns being returned
select 1 …
Matthew Warren12/15/2022, 4:30 PM
WITH expected_policies(DOMAIN, name, value) AS ( VALUES ('com.apple.applicationaccess', 'allowCloudDocumentSync', '0')) SELECT expected_policies.*, CASE WHEN managed_policies.domain IS NOT NULL THEN 'OK' ELSE NULL END complaince_check FROM expected_policies LEFT JOIN managed_policies ON (managed_policies.domain = expected_policies.domain AND managed_policies.name = expected_policies.name AND managed_policies.value = expected_policies.value) ORDER BY expected_policies.domain, expected_policies.name;
forces a null result as expected here. Does that look like the correct solution @Michal Nicpon or @Lucas Rodriguez?
Michal Nicpon12/16/2022, 1:12 PM
, otherwise you will always return at least 1 row from the
CTE. However, I think you could simplify the query to the following
SELECT 1 FROM managed_policies WHERE domain = 'com.apple.applicationaccess' AND name = 'allowCloudDocumentSync' AND value = '0';