drgonzo1967
MIS
Hello all. Just need a little help from someone who knows more sql then I (there must be millions).
Quick background:
Domain = DOMAIN.COM
OU1 = WORKSTATIONS (under domain.com where wkstation objects are created)
OU2 = TEST (located under WORKSTATIONS ou where objects are moved)
Goal: To display only objects in WORKSTATIONS and NOT in TEST.
Query1:
SELECT DISTINCT sys.name0, wks.ResourceID, wks.System_OU_Name0
FROM v_RA_System_SystemOUName wks join v_R_System sys
on wks.resourceid = sys.resourceid
WHERE System_OU_Name0 = 'DOMAIN.COM/WORKSTATIONS/TEST'
--Then created a View named 'system_ou_name0_test'
Query2:
SELECT sys.name0, wks.ResourceID, wks.System_OU_Name0
FROM v_RA_System_SystemOUName wks join v_R_System sys
on wks.resourceid = sys.resourceid
WHERE System_OU_Name0 = 'DOMAIN.COM/WORKSTATIONS'
--Then created a View named 'system_ou_name0_wks'
Query3:
select distinct *
from system_ou_name0_wks
where ?? not in
(select *
from system_ou_name0_test)
--The '??' is where I am unsure, QA is saying that is where my problem is. What do I need to put here? Will this work at all or am I doing this completely wrong?
Any help here would be greatly appreciated! tia.
-mike
Quick background:
Domain = DOMAIN.COM
OU1 = WORKSTATIONS (under domain.com where wkstation objects are created)
OU2 = TEST (located under WORKSTATIONS ou where objects are moved)
Goal: To display only objects in WORKSTATIONS and NOT in TEST.
Query1:
SELECT DISTINCT sys.name0, wks.ResourceID, wks.System_OU_Name0
FROM v_RA_System_SystemOUName wks join v_R_System sys
on wks.resourceid = sys.resourceid
WHERE System_OU_Name0 = 'DOMAIN.COM/WORKSTATIONS/TEST'
--Then created a View named 'system_ou_name0_test'
Query2:
SELECT sys.name0, wks.ResourceID, wks.System_OU_Name0
FROM v_RA_System_SystemOUName wks join v_R_System sys
on wks.resourceid = sys.resourceid
WHERE System_OU_Name0 = 'DOMAIN.COM/WORKSTATIONS'
--Then created a View named 'system_ou_name0_wks'
Query3:
select distinct *
from system_ou_name0_wks
where ?? not in
(select *
from system_ou_name0_test)
--The '??' is where I am unsure, QA is saying that is where my problem is. What do I need to put here? Will this work at all or am I doing this completely wrong?
Any help here would be greatly appreciated! tia.
-mike