Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
「... somelongexpression ...」は、実際の式ロジックのプレースホルダーです。
SELECT ...somelongexpression... AS subexpr, subexpr * 2 AS twicesubexpr FROM sometable;
しかし、「エラー:そのような列はありません:subexpr」が表示されます。
ある名前付き列式を別の列式で参照することはできませんか?
これは、この形式の SQL では不可能です。
サブクエリを使用する必要があります。
SELECT subexpr, subexpr * 2 AS twicesubexpr FROM (SELECT ...somelongexpression ... AS subexpr FROM sometable);