了解SQL Server SELECT INTO语句

Hey, readers! Hope you all are well. In the series of SQL SERVER, today we will be having a look at one of the most useful and interesting concept of SQL Server — SQL SERVER SELECT INTO Statement.

嘿,读者们! 希望大家一切都好。 在SQL SERVER系列文章中,今天我们将看看SQL Server最有用和最有趣的概念之一-SQL SERVER SELECT INTO语句



SQL SERVER SELECT INTO语句的工作 (Working of SQL SERVER SELECT INTO statement)

SQL Server SELECT INTO statement helps us create a new table within the same database with all or specific records from the selected(old) table. Moreover, we can add certain restrictions to the data being copied into the new table by validating it through certain conditions.

SQL Server SELECT INTO statement可帮助我们使用来自selected(old)表的所有或特定记录在同一数据库内创建一个新表。 此外,我们可以通过某些条件对其进行验证,从而对要复制到新表中的数据添加某些限制。

For example:

例如:

At times, it may happen that we would want our fellow developers or database engineers to work on the same database as ours. That is, it may happen that while developing a project, we would want our junior developers to work on a portion of the database.

有时,我们可能希望我们的开发人员或数据库工程师与我们在同一个数据库上工作。 也就是说,在开发项目时,我们可能希望初级开发人员在数据库的一部分上工作。

Moreover, we would also want to grant them entire access to any kind of alteration in the given database.

此外,我们还希望授予他们对给定数据库中任何种类的更改的完整访问权限。

This is when SQL SERVER SELECT INTO comes into picture.

这是SQL SERVER SELECT INTO出现的时候。

By this, a new table gets created in the database with the columns and data values from the selected/old table.

这样,数据库中就会创建一个新表,其中包含来自选定/旧表的列和数据值。

Now let us understand the structure of SQL Server SELECT INTO statement in the below section.

现在,让我们在下面的部分中了解SQL Server SELECT INTO语句的结构。



SQL SELECT INTO语句的语法 (Syntax of SQL SELECT INTO statement)

SQL Server SELECT INTO statement creates a new table within the same database and copies the data from the old table into it.

SQL Server SELECT INTO语句在同一数据库中创建一个新表,并将数据从旧表复制到该表中。

Syntax:

你可能感兴趣的:(数据库,mysql,java,sql,oracle)