DiigIT | IT Community
No Profile Image
Welcome Guest
New User? Register | Login
SQL
IT Tags

Simple insert Query

By: rekha singh | 28 Apr 2010 1:07 pm

Simple insert Query

insert into  <Table Name> <fileld name>values<field value>

 
Insert into sqldemo (id,password,status) values('sds','sad','sdsa');
 
Insert into <Table Name> select <column name1>,<column name N> from <Table name>
example
Insert into sqldemo select id,password,status from sqldemo1;
Here
->sqldemo is destination table
->sqldemo1 is source table
 
 
Insert into <Table Name> select <column name1>,<column name
n> from <table name> where <condition>
example
 
Insert into sqldemo select id,password,status from sqldemo1
where id like 'a%';
 
 
this query is used in inserting data into table.
 
 
 
 
 
 
 
 
 

Comments

No Comments Posted for this Article.

Leave a comment

Enter the text in the image
img
Can't read?
Type the characters you see in the picture below.


Close Move