LoginSignup
0
0

SELECT句でつけた別名をORDER BYでは使えてGROUP BYでは使えない理由

Posted at

SELECT文の内部的な実行順序

FROM → WHERE → GROUP BY → HAVING → SELECT → ORDER BY

上の実行順序が重要になる。
SELECT句を実行するまでは、別名は付けられていないので、当然WHEREやGROUP BYで別名を使うことはできない。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0