![]() ![]() WE can copy only structure and create a new table like this. Three columns id, name and marks is copied to new table student2.ĬREATE TABLE student2 SELECT id,name, mark FROM student Copy table structure only This way we can use any conditional requirements by using where clause to create The new table student2 will have these records So our new table will contain the records of class four only.ĬREATE TABLE student2 SELECT * FROM student WHERE class='Four'With this command we will create a new table student2 of same structure of main table student and all the records of class = Four will be copied to the new table. We will apply our sql command to this table to create a new table and we willĬopy records for which class = Four. This way selectively we can transfer records to a new table. This became more useful when we add conditions to this by using SQL WHEREĬommand. This will create a new table student2 using the structure of the table student and will copy all the records from table student to our new table student2. Related Tutorial Exporting data to table Downloading records to csv file SQL Rename table
0 Comments
Leave a Reply. |