私はテスターであり、私はたくさんの選択クエリを実行して、テストしている情報を除外しなければなりません。SQLでグローバル変数を定義して使用する方法
グローバル変数を作成し、同じ値を貼り付けるのではなく、それを使用する方法はありますか?
サンプルコード:
Select l.prod_package,m.* from avtt7m0 m, avtt7l0 l
where l.cust_id='52317162090004'
and l.ar_id=m.ar_id and m.lc_st_code='ACT';
Select m.* from avtt7m0 m, avtt7l0 l
where l.cust_id='52317162090004'
and l.ar_id=m.ar_id and m.lc_st_code='ACT';
Select * From AKTTD90
where cust_id in ('52317162090004');
Select * From Kndt7m0
where cust_id in ('52317162090004');
t-sql変数を使用して事前に設定することができます。画像の代わりに使用しているコードを投稿すると、使用方法がわかります –
使用しているdbmsはどれですか。 (答えはおそらく製品固有のものです。) – jarlh
私はSQL開発者を使用しています。 avtt7m0 m、avtt7l0 lからl.prod_package、m。*を選択します。ここで、l.cust_id = '52317162090004'とl.ar_id = m.ar_idとm.lc_st_code = 'ACT'です。 avtt7m0 m、avtt7l0 lからm。*を選択します。ここで、l.cust_id = '52317162090004'、l.ar_id = m.ar_id、m.lc_st_code = 'ACT'です。 選択* AKTTD90からcust_id in( '52317162090004'); 選択* Kndt7m0からcust_id in( '52317162090004'); – VItas