My question is the following :
SQL table with multiple records, multiple attributes.
Lets select it :
select * from jaikudo
returns:
(id, created, createdByWho,relatedToWho,worksWithWho )
The job to fulfil :
when I : select * from jaikudo where createdByWho = 1
returns 1 record.
I have worksWithWho table with approx 5000 records. The Id is PK, not necessearely ascending or descending but random numbers
When I : select * from worksWithWho
returns (id, created, createdByWho,)
I need to insert records into the jaikudo table based on the following
`select * from jaikudo where createdByWho = 1`
returns 1 record (id, created, createdByWho,relatedToWho,worksWithWho )
copy the details : (createdByWho,relatedToWho)
created will pull the getdate () info and insert as the following :
Create new record in the jaikudo table for each worksWithWho data ( which is unique ) and fill the remaining fields ( createdbyWho and relatedToWho ) with the data copied from the following query : select * from jaikudo where createdByWho = 1
When it`s done, I have to have approx 5000 new record in the jaikudo table, but if its possible, some error detection would be good as IF the jaikudo table already having the exact same relation then skip the record and continue.
Thanks.