sql注入语句示例大全
SQL Select Into语句有什么作用? (What does the SQL Select Into statement do?)
The SELECT INTO
statement is a query that allows you to create a new table and populate it with the result set of a SELECT statement
.
SELECT INTO
语句是一个查询,使您可以创建一个新表,并使用SELECT statement
的结果集填充该SELECT statement
。
To add data to an existing table, see the INSERT INTO statement instead.
要将数据添加到现有表中,请参阅INSERT INTO语句。
SELECT INTO
can be used when you are combining data from several tables or views into a new table.1 The original table is not affected.
SELECT INTO
当你从几个表或视图中的数据组合成一个新的table.1原来的表不会受到影响,可以使用。
The general syntax is:
通用语法为:
SELECT column-names
INTO new-table-name
FROM table-name
WHERE EXISTS
(SELECT column-name
FROM table-name
WHERE condition)
This example shows a set of a table that was “copied” from the “Supplier” table to a new one called SupplierUSA which holds the set related to the column country of value ‘USA’.
此示例显示了一个表集,该表集是从“供应商”表中“复制”到一个名为SupplierUSA的新表中的,该表中包含与值“ USA”的列国家有关的集合。
SELECT * INTO SupplierUSA
FROM Supplier
WHERE Country = 'USA';
Results : 4 rows affected 2
结果 :4行受影响2
ID | CompanyName | ContactName | City | Country | Phone |
---|---|---|---|---|---|
2 | New Orleans Cajun Delights | Shelley Burke | New Orleans | USA | (100) 555-4822 |
3 | Grandma Kelly’s Homestead | Regina Murphy | Ann Arbor | USA | (313) 555-5735 |
16 | Bigfoot Breweries | Cheryl Saylor | Bend | USA | NULL |
19 | New England Seafood Cannery | Robb Merchant | Boston | USA | (617) 555-3267 |
ID | 公司名 | 联系人姓名 | 市 | 国家 | 电话 |
---|---|---|---|---|---|
2 | 新奥尔良Cajun美食 | 雪莉·伯克 | 新奥尔良 | 美国 | (100)555-4822 |
3 | 凯利奶奶的家园 | 里贾纳·墨菲 | 安阿伯 | 美国 | (313)555-5735 |
16 | 大脚怪啤酒厂 | 谢丽尔·塞勒 | 弯曲 | 美国 | 空值 |
19 | 新英格兰海鲜罐头厂 | 罗伯商人 | 波斯顿 | 美国 | (617)555-3267 |
Please see the manual for your database manager and have fun trying different options yourself.
请参阅数据库管理员的手册,并尝试自己尝试其他选项,这很有趣。
Further reading:
进一步阅读:
(Microsoft - Inserting Rows by Using SELECT INTO)[https://technet.microsoft.com/en-us/library/ms190750(v=sql.105).aspx]
(Microsoft-通过使用SELECT INTO插入行)[ https://technet.microsoft.com/zh-cn/library/ms190750(v= sql.105) .aspx ]
(dofactory - SQL SELECT INTO Statement)[http://www.dofactory.com/sql/select-into]
(dofactory-SQL SELECT INTO语句)[ http://www.dofactory.com/sql/select-into ]
翻译自: https://www.freecodecamp.org/news/sql-select-into-statement-explained-with-examples/
sql注入语句示例大全