在MySQL中,“每个派生表必须有自己的别名”的错误是什么?我正在MySQL上运行这个查询。SELECT ID FROM (
SELECT ID, msisdn FROM (
SELECT * FROM TT2 ));它带来了这样的错误:每个派生表都必须有自己的别名。是什么导致了这个错误?
3 回答
aluckdog
TA贡献1847条经验 获得超7个赞
SELECT IDFROM (SELECT ID, msisdn FROM (SELECT * FROM TT2) as myalias ) as anotheralias;
慕田峪4524236
TA贡献1875条经验 获得超5个赞
GROUP BY DISTINCT
).
purchases
customers
stores
SELECT DISTINCT customer_id, SUM(1) FROM ( SELECT DISTINCT customer_id, store_id FROM purchases) GROUP BY customer_id HAVING 1 < SUM(1);
Every derived table must have its own alias
SELECT DISTINCT customer_id, SUM(1) FROM ( SELECT DISTINCT customer_id, store_id FROM purchases) AS custom GROUP BY customer_id HAVING 1 < SUM(1);
AS custom
添加回答
举报
0/150
提交
取消