我是一名测试人员,我必须运行大量的选择查询来筛选出我正在测试的信息。如何在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