2000字范文,分享全网优秀范文,学习好帮手!
2000字范文 > SQL Select语句:Select Distinct Select Into Insert into等示例

SQL Select语句:Select Distinct Select Into Insert into等示例

时间:2021-05-15 16:36:17

相关推荐

SQL Select语句:Select Distinct Select Into Insert into等示例

Select和From子句 (Select and From clauses)

The SELECT part of a query is normally to determine which columns of the data to show in the results. There are also options you can apply to show data that is not a table column.

查询的SELECT部分​​通常是确定要在结果中显示数据的哪几列。 您还可以应用其他选项来显示不是表列的数据。

This example shows three columns selected from the “student” table and one calculated column. The database stores the studentID, FirstName, and LastName of the student. We can combine the First and the Last name columns to create the FullName calculated column.

本示例显示了从“学生”表中选择的三列和一个计算出的列。 该数据库存储该学生的studentID,FirstName和LastName。 我们可以组合名字和姓氏列来创建FullName计算列。

select studentID, FirstName, LastName, FirstName + + LastName as FullNamefrom student;

+-----------+-------------------+------------+------------------------+| studentID | FirstName | LastName | FullName|+-----------+-------------------+------------+------------------------+| 1 | Monique | Davis| Monique Davis|| 2 | Teri | Gutierrez | Teri Gutierrez || 3 | Spencer | Pautier | Spencer Pautier || 4 | Louis | Ramsey| Louis Ramsey || 5 | Alvin | Greene| Alvin Greene || 6 | Sophie | Freeman | Sophie Freeman || 7 | Edgar Frank "Ted" | Codd | Edgar Frank "Ted" Codd || 8 | Donald D. | Chamberlin | Donald D. Chamberlin || 9 | Raymond F. | Boyce| Raymond F. Boyce |+-----------+-------------------+------------+------------------------+9 rows in set (0.00 sec)

*As with all of these SQL things there is MUCH MORE to them than what’s in this introductory guide.

*与所有这些SQL事物一样,它们比本入门指南中的内容要多得多。

I hope this at least gives you enough to get started.

我希望这至少能给您足够的入门。

Please see the manual for your database manager and have fun trying different options yourself.

请参阅数据库管理员的手册,并尝试自己尝试其他选项,这很有趣。

SQL选择不同的语句

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。