我是一名測試人員,我必須運行大量的選擇查詢來篩選出我正在測試的信息。如何在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'; 選擇* From AKTTD90 where cust_id in('52317162090004'); 選擇*從Kndt7m0 where cust_id in('52317162090004'); – VItas