我在 MySQL 上运行此查询
I am running this query on MySQL
SELECT ID FROM (
SELECT ID, msisdn
FROM (
SELECT * FROM TT2
)
);
它给出了这个错误:
每个派生表都必须有自己的别名.
Every derived table must have its own alias.
是什么导致了这个错误?
What's causing this error?
每个派生表(也称为子查询)确实必须有一个别名.IE.括号中的每个查询都必须有一个别名(AS 随便
),它可以用于在外部查询的其余部分中引用它.
Every derived table (AKA sub-query) must indeed have an alias. I.e. each query in brackets must be given an alias (AS whatever
), which can the be used to refer to it in the rest of the outer query.
SELECT ID FROM (
SELECT ID, msisdn FROM (
SELECT * FROM TT2
) AS T
) AS T
当然,在您的情况下,整个查询可以替换为:
In your case, of course, the entire query could be replaced with:
SELECT ID FROM TT2
这篇关于“每个派生表必须有自己的别名"是什么错误?在 MySQL 中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!