自动化框架查询数据库使用语句

SELECT * FROM `testdatas_inputtapinputtext` WHERE newaddandcheck_id=185 union all SELECT * FROM `testdatas_selecttapselectoption` WHERE newaddandcheck_id=185
联表查询 同一个newaddandcheck_id的 表 testdatas_inputtapinputtext中input_ele_find_value、
              表 testdatas_inputtapinputfile  中input_ele_find_value、
              表 testdatas_inputtapinputdatetime 中 input_ele_find_value
             表  testdatas_radioandreelectionlabel 中 label_ele_find_value
            表 testdatas_selecttapselectoption 中 select_ele_find_value
            表  testdatas_asserttiptext  中 tip_ele_find_value
            表  testdatas_iframebodyinputtext 中 iframe_ele_find_value
set @Id = 185;
SELECT input_ele_find_value FROM `testdatas_inputtapinputtext` WHERE newaddandcheck_id=@Id  union all
SELECT input_ele_find_value FROM `testdatas_inputtapinputfile` WHERE newaddandcheck_id=@Id   union all
SELECT input_ele_find_value FROM `testdatas_inputtapinputdatetime` WHERE newaddandcheck_id=@Id   union all
SELECT label_ele_find_value FROM `testdatas_radioandreelectionlabel` WHERE newaddandcheck_id=@Id  union all
SELECT select_ele_find_value FROM `testdatas_selecttapselectoption` WHERE newaddandcheck_id=@Id  union all
SELECT tip_ele_find_value FROM `testdatas_asserttiptext` WHERE newaddandcheck_id=@Id  union all
SELECT iframe_ele_find_value  FROM `testdatas_iframebodyinputtext` WHERE newaddandcheck_id=@Id;
 
内联:
set @Id = 185;
SELECT * FROM `testdatas_inputtapinputtext` inner join `testdatas_inputtapinputfile` on testdatas_inputtapinputfile.newaddandcheck_id = testdatas_inputtapinputtext.newaddandcheck_id 

一个字段多个值查询语言:
select input_ele_find_value from testdatas_inputtapinputtext where newaddandcheck_id in(165,179,180,181,182,183,184,185,186,187,188,189,190,191)
可以修改的:
select * from testdatas_inputtapinputtext where newaddandcheck_id in(165,179,180,181,182,183,184,185,186,187,188,189,190,191)     增加场景依赖输入框
带变量:
set @IdS1=165, @IdS2=179, @IdS3=180,@IdS4=181,@IdS5=182,@IdS6=183,@IdS7=184,@IdS8=185,@IdS9=186,@IdS10=187,@IdS11=188,@IdS12=189,@IdS13=190,@IdS14=191;
select * from testdatas_inputtapinputtext where newaddandcheck_id in (@IdS1,@IdS2,@IdS3,@IdS4,@IdS5,@IdS6,@IdS7,@IdS8,@IdS9,@IdS10,@IdS11,@IdS12,@IdS13,@IdS14)         增加场景-文本输入框
select * from testdatas_inputtapinputfile where newaddandcheck_id in (@IdS1,@IdS2,@IdS3,@IdS4,@IdS5,@IdS6,@IdS7,@IdS8,@IdS9,@IdS10,@IdS11,@IdS12,@IdS13,@IdS14)         增加场景-文件输入框
select * from testdatas_inputtapinputdatetime where newaddandcheck_id in (@IdS1,@IdS2,@IdS3,@IdS4,@IdS5,@IdS6,@IdS7,@IdS8,@IdS9,@IdS10,@IdS11,@IdS12,@IdS13,@IdS14)         增加场景-时间输入框
select * from testdatas_radioandreelectionlabel where newaddandcheck_id in (@IdS1,@IdS2,@IdS3,@IdS4,@IdS5,@IdS6,@IdS7,@IdS8,@IdS9,@IdS10,@IdS11,@IdS12,@IdS13,@IdS14)         增加场景-单选复选框
select * from testdatas_selecttapselectoption where newaddandcheck_id in (@IdS1,@IdS2,@IdS3,@IdS4,@IdS5,@IdS6,@IdS7,@IdS8,@IdS9,@IdS10,@IdS11,@IdS12,@IdS13,@IdS14)         增加场景-选项框
select * from testdatas_asserttiptext where newaddandcheck_id in (@IdS1,@IdS2,@IdS3,@IdS4,@IdS5,@IdS6,@IdS7,@IdS8,@IdS9,@IdS10,@IdS11,@IdS12,@IdS13,@IdS14)         增加场景-验证文本
select * from testdatas_iframebodyinputtext where newaddandcheck_id in (@IdS1,@IdS2,@IdS3,@IdS4,@IdS5,@IdS6,@IdS7,@IdS8,@IdS9,@IdS10,@IdS11,@IdS12,@IdS13,@IdS14)         增加场景-验证富文本
select * from testdatas_newaddandcheck where id in (@IdS1,@IdS2,@IdS3,@IdS4,@IdS5,@IdS6,@IdS7,@IdS8,@IdS9,@IdS10,@IdS11,@IdS12,@IdS13,@IdS14) 
 
 
 
 
 
 
 
 
原文地址:https://www.cnblogs.com/jingzaixin/p/11957327.html