Forums
 This topic is locked 
             SELECT and INSERT INTO
 Posted 18 Mar 2002  20:11:21 
  1 
     has   voted 
  18 Mar 2002  20:11:21 Frank Hierse posted: 
 Hello,I would like to store records of a table into another table.
INSERT INTO Tab2 (Spalte1,Spalte2)...) SELECT Spalte1,Spalte2,... FROM Tab1
However all records always are inserted in Tab2 from Tab1. I would like to select the records in the Tab1 previously and then I would like to insert only the selected records into the Tab2.
Which possibilities are there for it? Maybe you have a few suggestions.
Ciao Frank
Greetings from Germany
Replies
 Replied 03 Apr 2002  09:28:12 
   03 Apr 2002  09:28:12 Bruno Mairlot replied: 
  In your query, use the following modification : 
INSERT INTO Tab2 (Spalte1,Spalte2)...) SELECT Spalte1,Spalte2,... FROM Tab1 <b>WHERE ....</b>
Then, your select of Tab1 will be limited to your filter, and therefore only the selected rows from Tab1 will be inserted into tab2.
Hope it helps.
Bruno
--- Better to die trying, than never try at all ---
  INSERT INTO Tab2 (Spalte1,Spalte2)...) SELECT Spalte1,Spalte2,... FROM Tab1 <b>WHERE ....</b>
Then, your select of Tab1 will be limited to your filter, and therefore only the selected rows from Tab1 will be inserted into tab2.
Hope it helps.
Bruno
--- Better to die trying, than never try at all ---
