Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa SQL MySQLselect into new table Example code
Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Java Coder
MySQLselect into new table Example code
1 Answer(s)      3 months and 15 days ago
Posted in : SQL


Hi,

I have a big table in MySQL database and I want to create a new table with all the data in it. I have heard that there is SQL statement "mysql select into new table" which selects the data from one table and create and insert data into new table. What is the correct statement for selecting the records from one table and creating and inserting the data into another table?

Thanks


Advertisement
View Answers

July 9, 2014 at 3:24 PM


Hi,

Hi suppose you have a table1 and you want to save all the records from table1 into another table. Then follow the steps given below:

First of create a table table2 with the same structure as table1.

Now run the following statement:

insert INTO table2 SELECT * from table1;

Above sql statement will insert all the data from table1 into table2.

Thanks



Related Tutorials/Questions & Answers:
MySQLselect into new table Example code
MySQLselect into new table Example code  Hi, I have a big table in MySQL database and I want to create a new table with all the data in it. I have heard that there is SQL statement "mysql select into new table" which selects
mysql select into table from another table example
from one table into another table. Check the example at MySQLselect into new table Example code Thanks... the correct example of select into table from another table example in MySQL
Advertisements
MySQL take backup of a table - example code needed
MySQL take backup of a table - example code needed  How to take backup of a table in MySQL? I have a database which contains many tables. What is the command to take the backup of one table with data from database? Thanks
How to solve this java code by adding the student marks not in the list of the table. For example -10 and 156 in GUI?
How to solve this java code by adding the student marks not in the list of the table. For example -10 and 156 in GUI?  import java.awt.*; import...[] args) { JLabel lab=new JLabel("Enter number of students in class
Code to register a new patient in a clinic
Code to register a new patient in a clinic  Hi, How do i write a code that allows a user to enter someone's name and then search for that name from a text file. If the name is not available it opens up a form to register
example code
example code  code for displaying a list from another class on a midlet
Adding a New Column Name in Database Table
; Above code is used for adding a new column in the database table and takes... new column in table example! Enter table name: Student... Adding a New Column Name in Database Table  
how to create a new table for the already existing user in the website
how to create a new table for the already existing user in the website  haiii....i want the code in jsp "how to create a new database for every user that has been already existing in the website?"....plzzzz help me
my table should be reseted to new value upon the selection of the combo box..
my table should be reseted to new value upon the selection of the combo box... DefaultTableModel(); table = new JTable(model); model.addColumn(" INVO... e) { } public void keyTyped(KeyEvent e) { }}); sc1 = new JScrollPane(table
How do we create new table apart from mapping with existing table ?
How do we create new table apart from mapping with existing table ?  Hi, How do we create new table apart from mapping with existing table ? Thanks
jsp code for allocating a room for a new guest
jsp code for allocating a room for a new guest  i am implementing a project on online hotel reservation system.please give code in jsp to allocate a room for a guest
Example Code
Example Code       Example Code Following are the some of example code with demos :  jQuery blur event jQuery change event
HTML table example
HTML Table example In this page we will learn how to use HTML table tag... form on the web page. Here is an example of HTML Table... applications The above example shows how to use table tag
How To Insert A New Record to MS Access table database in GUI
How To Insert A New Record to MS Access table database in GUI  Hello... that involves inserting a record into a 6-column table in my MS Access database table. I'm... in advance for your help. Below is part of my java code. private class
Add new column to table using DBCP
Code: import java.sql.*; import org.apache.commons.dbcp.BasicDataSource; public class AddColumn {   public static void main(String[] args) {   
Change Column Name of a Table
;    This section provides you an example with code... of code: ALTER TABLE   table_name   CHANGE   old...;+table+" CHANGE "+old_col+" "+new_col+" 
Table & the Border attribute
;    The Tutorial illustrates an example from Table and the Border attribute. In this Tutorial, the code explains to create a table and the border with a specified attribute. Understand with Example To create a table in HTML
Pagination example with html code
Pagination example with html code  Hi, could u please provide pagination code with clear cut explanation. Thanks in advance
Arrange a Column of Database Table
;    This section provides an example with code...;java ColumnDescOrder Descending order example! Enter table name...; This section provides an example with code that arrange the records
servlet code for finding the table for given number
servlet code for finding the table for given number  servlet code for finding the table for given number?   Here is a an example that accepts a number from the user and display its multiplication table using servlet. 1
Example Code - Java Beginners
Example Code  I want simple Scanner Class Example in Java and WrapperClass Example. What is the Purpose of Wrapper Class and Scanner Class . when i compile the Scanner Class Example the error occur : Can not Resolve symbol
Need an example of basic code.
Need an example of basic code.   Im working on an art project that I want to use some code in, and I am proficient in python but that looks fairly... of the building blocks of my idea so if someone could provide an example I would
Need an example of basic code.
Need an example of basic code.   Im working on an art project that I want to use some code in, and I am proficient in python but that looks fairly... of the building blocks of my idea so if someone could provide an example I would
Need an example of basic code.
Need an example of basic code.   Im working on an art project that I want to use some code in, and I am proficient in python but that looks fairly... of the building blocks of my idea so if someone could provide an example I would
MPVolumeView Example code
MPVolumeView Example code  Hi, Please let's know how I can add MPVolumeView control in my iPhone application? Thanks   Hello, You can use the following code: MPVolumeView *volumeView = [[[MPVolumeView alloc
new
new   @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ <%@page contentType...="submit"><br><br><br> <table border="2">... { /* * TODO output your page here. You may use following sample code
Dragging and dropping HTML table row to another position(In Jsp) and save the new position (values) also in database
Dragging and dropping HTML table row to another position(In Jsp) and save the new position (values) also in database  Hi members, I have one Html table in jsp page and i am iterating values (in columns of html table)from
new
new    hi i am jane pls explain the difference between string greeting = good morning string greeting = new string ("good morning
new
new  hi the difference between string sname = good morning string sname =new("good morning
new
new    hi i am jane pls explain the difference between heap memory and stack memory
No complete code for AbstractWizardFormCOntroller Example
No complete code for AbstractWizardFormCOntroller Example  No complete codes
 

 

 

DMCA.com