recordset question

Results 1 to 2 of 2

Thread: recordset question

  1. #1
    Join Date
    Dec 1969

    Default recordset question

    I have two tables with one field in common like below. In Table2, the boxno 2 exists, but it doesn&#039;t in Table1. I need to know how to interate thru and add one record to Table1 for each unique boxno that exists in Table2, but not in Table1.<BR><BR>Table1:<BR>ID, boxno<BR>1, 1<BR><BR>Table2:<BR>EntryID, boxno<BR>497, 1<BR>498, 1<BR>499, 1<BR>500, 2<BR>501, 2<BR>502, 2<BR>

  2. #2
    Join Date
    Dec 1969

    Default sql answer

    insert into table1(boxno) select distinct boxno from table2 where boxno not in (select boxno from table1)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts