Haybails90
Programmer
Hey Folks,
I'm here to request some assistance in creating a statement.
I have two tables:
* groups_members -- a Cross Referencing table consisting of only two fields - GroupID (referencing a record in a 'groups' table) and EmpAutoID (referencing a record in an 'employees' table)
and
* employees (is a standard employee table with AutoID being the key of each employee record).
Here's what I need to do:
1.) I need a record created in the groups_members table for every employee in the employees table.
2.) This record in the groups_members table must have a GroupID of 181 and an EmpAutoID of the employees AutoID from the employees table.
3.) I need to make sure, of course, that I don't create a duplicate record within the groups_members table (for example, if a 181/employeeID record already exists in groups_members).
4.) Now, each employeeID may have multiple records in the groups_members table (referencing different GroupID numbers) but only one occurance of each EmpAutoID associated with a GroupID of 181).
Make sense?
I do my SQL statements in Query Analyzer. Feel free to ask for clarification if you need more information. Any and all assistance is greatly appreciated.
Haybails90
I'm here to request some assistance in creating a statement.
I have two tables:
* groups_members -- a Cross Referencing table consisting of only two fields - GroupID (referencing a record in a 'groups' table) and EmpAutoID (referencing a record in an 'employees' table)
and
* employees (is a standard employee table with AutoID being the key of each employee record).
Here's what I need to do:
1.) I need a record created in the groups_members table for every employee in the employees table.
2.) This record in the groups_members table must have a GroupID of 181 and an EmpAutoID of the employees AutoID from the employees table.
3.) I need to make sure, of course, that I don't create a duplicate record within the groups_members table (for example, if a 181/employeeID record already exists in groups_members).
4.) Now, each employeeID may have multiple records in the groups_members table (referencing different GroupID numbers) but only one occurance of each EmpAutoID associated with a GroupID of 181).
Make sense?
I do my SQL statements in Query Analyzer. Feel free to ask for clarification if you need more information. Any and all assistance is greatly appreciated.
Haybails90