CREATE TABLE as SELECT * FROM and insert to select from two table copy statement differences[SQL]View PlainCopy
Create table targer_table as select * from source_table
INSERT INTO target_table (column1,column2) select Column1,column2
The SQL SELECT into statement can be used to create a backup copy of the table.SELECT into statementThe SELECT INTO statement selects data from one table and then inserts the data into another table.The SELECT into statement is commonly used to
SQL statement + select top usage of "Fetch 10th to 20th records from a data table", 10th SQL statements
1. First, select top usage:
For more information, see the differences between select top n * from and select * from.
Select * from table --
Many sites have a select * from table where 1=1 the introduction of such statements, and, for this class of statements, it is really to make people look more and more confused (a copy of a, simply outrageous), do not know what is said, Cause a lot
Link: http://www.it118.org/Specials/c9fba99e-4401-49cf-8256-ac3c1a34c0d9/cf2a7ceb-1815-43fe-8810-47af11ac65a9.htm
Two methods can be implemented without using a cursor. The following two methods provide better performance than a cursor.
1. INSERT
1. Add Field
ALTER TABLE DOCDSP Add Dspcode
CHAR (200)
2. Delete fields
ALTER TABLE table_name DROP COLUMN
column_name
3. Modify the field type
ALTER TABLE TABLE_NAME ALTER COLUMN
column_name New_data_type
4.sp_rename renamed
EXEC
The syntax is as follows:1. Description: copy a table (only copy structure, source table name: a new table name: B) (access available)Method 1: Select * into B from a where 1 <> 1Method 2: Select top 0 * into B from
2. Description: copy a table
Oracle is a database management system, which is a relational database management system. Usually we call the "database", contains the physical data, database management system, memory, operating system of the composition of the process, refers to
From: http://www.2cto.com/database/201206/134514.html
0. Create a database tableMysql> create database if not exists my_db default charset utf8 COLLATE utf8_general_ci;# Pay attention to the following sentence "COLLATE utf8_general_ci", which
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.