SQL update delete

- inserting data 
the INSERT  the INTO  [ the Salary ]  the VALUES ( 25451 , 4545 , 45 )
 the INSERT  the INTO  [ the Salary ] (number, income, expenses) the VALUES ( 25451 , 4545 , 487 )
 - does not provide a default value inserted into the column name, the primary key repeat Errors will occur 
-the structure of the two tables is consistent, you can query the data of another table and insert it into the table 
-you can use select into to copy the specified data in the table, create a new table to paste 



- update and delete the data table 
UPDATE  [ Salary ]  set  [ Revenue ] = 12345  whereID = 25451 
- no where will make the entire column change 

delete  FROM  [ Salary ]  WHERE ID = 25451 
- no where will make the entire table data lost 
- delete all data transactions and all records in the table 
TRUNCATE  TABLE  [ Salary2 ] ;

 

Guess you like

Origin www.cnblogs.com/LBJN/p/12757781.html