sql查询语句中个,select * from 表 where 开票单号=??
我想实现?? 这里同时可以动态查询多个单号的记录,
select * from 表 where 开票单号=? or 开票单号=?
1.根据条件查询出多个单号 :select 单号,记录 from table where 条件
2.根据多个单号查询多条记录 :select * from table where 单号=** or 单号=**
单号是一个变量,比如S="001,002,0003等等“
select * from 表 where 开票单号 in(单号1,单号2,单号3,单号4,....);
--注意:如果单号为字符型,那么要加单引号,整形就不用了;如果想动态传参,那么可通过存储过程形式传参
Dim aa As String
aa = “0001,0002,003,004”
sql1 = "select * from frmout where 开票单号 in ( aa )"
sql1 = "select * from frmout where 开票单号 in (" & aa & )"现在不正常