A Query is only a SELECT statement. INSERT is not a query. Mike On Thu, Sep 8, 2011 at 12:54 PM, Jignesh Makwana <[email protected]>wrote:
> David appreciate your patience. > > Regards, > Jignesh Makwana > On Sep 8, 2011 9:31 PM, "ddf" <[email protected]> wrote: > > > > > > On Sep 6, 5:10 am, Kishor Mali <[email protected]> wrote: > >> hey what sql command is used to insert values in a table from another > table > >> > > > > Your question is: > > > > 1) Answered in any number of newsgroups/forums found by searching > > google.com > > 2) Does not belong in this thread as it doesn't apply to the original > > posted inquiry > > > > That being said and realizing you'll probably come back here to find a > > response because you think that's easier than looking for the answer > > with google: > > > > SQL> create table src( > > 2 id number, > > 3 val varchar2(40) > > 4 ); > > > > Table created. > > > > SQL> > > SQL> create table dst( > > 2 id number, > > 3 val varchar2(40) > > 4 ); > > > > Table created. > > > > SQL> > > SQL> begin > > 2 for i in 1..50000 loop > > 3 insert into src > > 4 values(i, 'Test value '||i); > > 5 end loop; > > 6 > > 7 commit; > > 8 > > 9 end; > > 10 / > > > > PL/SQL procedure successfully completed. > > > > SQL> > > SQL> select count(*) From src; > > > > COUNT(*) > > ---------- > > 50000 > > > > SQL> > > SQL> select count(*) from src where id <20001; > > > > COUNT(*) > > ---------- > > 20000 > > > > SQL> > > SQL> insert into dst > > 2 (id, val) > > 3 select id, val from src where id < 20001; > > > > 20000 rows created. > > > > SQL> > > SQL> commit; > > > > Commit complete. > > > > SQL> > > SQL> select count(*) From dst; > > > > COUNT(*) > > ---------- > > 20000 > > > > SQL> > > SQL> select count(*) from src where id <20001; > > > > COUNT(*) > > ---------- > > 20000 > > > > SQL> > > > > I hope it's clear how to do this. > > > > > > David Fitzjarrell > > > > -- > > You received this message because you are subscribed to the Google > > Groups "Oracle PL/SQL" group. > > To post to this group, send email to [email protected] > > To unsubscribe from this group, send email to > > [email protected] > > For more options, visit this group at > > http://groups.google.com/group/Oracle-PLSQL?hl=en > > -- > You received this message because you are subscribed to the Google > Groups "Oracle PL/SQL" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/Oracle-PLSQL?hl=en > -- You received this message because you are subscribed to the Google Groups "Oracle PL/SQL" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Oracle-PLSQL?hl=en
