-1
私は派生テーブルに別名を与えましたが、依然としてクエリを実行すると「すべての派生テーブルには別のエイリアスが必要です」というエラーが表示されます。すべての派生テーブルには別のエイリアスが必要ですか?どのように間違っていますか
select a,b,c,sum(d) as 'sum'
from(select a,b,c,sum(d)as 'd' from e join f using(z)) as 'alias'
group by a;
EDIT: better sample
----This gives derived table error-----
select name,sum(pop) as 'total' from(select name as 'name',sum(population)
as pop from table1 join table2 using(countrycode));
----This gives me the SQL syntax error--------
select name,sum(pop) as 'total' from(select name as 'name',sum(population)
as pop from table1 join table2 using(countrycode)) as 'alias';
ありがとうございます。
を.... –
あなたは[MCVE]を思い付くしようとすることができます - 例えば人々がエラーを再現できるシンプルなスキーマ定義ですか?現在のコードは匿名化されているため、問題がどこにあるかは分かりません。 – IMSoP
@ IMSoP doneサー。 – Supremo