I have the following 3 tables. I need a single query to select from table 1 if either a matching record is found in table 2 or table 3. 

Table 1: 
RecordID,
GroupID,
Name

Table 2:
RecordID (which is Table1.RecordID),
SubID,
AFlag

Table 3:
GroupID (which is Table1.GroupID),
SubID,
AFlag