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.
SQL言語を使用しているPostgreSQLストアドプロシージャ内で変数を使用することは可能ですか?
可能であれば、選択からの結果をそれらに割り当て、後でそれらを使用する方法。
いいえ、SQL 言語関数は、それが SELECT の場合はスカラー値を返すことができますが、SQL 関数には変数がありません。(私が考えることができる最も近いのは、CTE を使用することです。)
言語 plpgsql を使用する場合は、変数を宣言できます。