DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: insert

  1. #1
    pm Guest

    insert


    hi, my task= insert * from table B into table A where the records in table
    B doesn't exist in table A.

    hilfe.

  2. #2
    Dale Guest

    Re: insert


    To get the records in tableB that are not in A:
    SELECT * FROM tableB LEFT JOIN tableA
    ON tableB.ID = tableA.ID
    WHERE tableA.ID IS NULL

    You can then insert those records into tableA:
    INSERT INTO tableA
    SELECT * FROM tableB LEFT JOIN tableA
    ON tableB.ID = tableA.ID
    WHERE tableA.ID IS NULL

    "pm" <pontolan@hotmail.com> wrote:
    >
    >hi, my task= insert * from table B into table A where the records in table
    >B doesn't exist in table A.
    >
    >hilfe.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center