使用“AS"在 MySQL 中 - 不是别名 [英] Using "AS" in MySQL - not as aliases

查看:58
本文介绍了使用“AS"在 MySQL 中 - 不是别名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我看到以下内容时,我有点惊讶:

I was kinda surprised when I saw following:

CREATE TEMPORARY TABLE X (ID int) AS SELECT NumColumn FROM Table

我试图用谷歌搜索它,但只发现使用它作为别名.这个用途究竟是什么?我感到有点困惑,因为我愚蠢地创建了临时表,然后使用插入来填充它..

I have tried to google it but only found using this as alieases. What this use actually is? I feel bit confused since I was stupidly creating temporary table and then fill it by using of insert..

谢谢

推荐答案

它是如何创建临时表并用选择查询的结果填充它的.

Its how you create a temporary table and populate it with the results of a select query.

您可以在在文档中看到它在 CREATE TABLE 规范的最底层

You can see it in the documentation at the very bottom of the CREATE TABLE specification

选择语句:
[忽略 |REPLACE] [AS] SELECT ...(一些合法的选择语句)

select_statement:
[IGNORE | REPLACE] [AS] SELECT ... (Some legal select statement)

这篇关于使用“AS"在 MySQL 中 - 不是别名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆