cwlr.net
当前位置:首页 >> Asp里的sql查询语句 >>

Asp里的sql查询语句

sql="select * from user_info where "name='" &session("session_name") & "'and ziduan "&" like '%"&key&"%'"

用or查询不走索引,效果不理想,建议用in, 如果该查询字段建了索引,in会极大的提高查询速度 select * from Table where xx in ('1','2','3'); 你也可以考虑把参数放到1个数组中,循环生成sql中条件的部分

rem查询方法2 sql="select * from [user] " Set Rs = Server.CreateObject("ADODB.RecordSet") Rs.Open Sql,Conn,1,1

没有更简便的写法,或者换成union,不确定access是否支持,看着只会更复杂: select * from biao where A =1 union select * from biao where B=1 union select * from biao where C=1

asp五种操作数据库语句示例2007年06月26日 星期二 13:37.数据库连接示例 用来单独编制连接文件conn.asp < % Set conn = Server.CreateObject("ADODB.Connection") conn.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath...

string a = "select XXXX from XXXX"; //连接数据库 SqlConnection myCon = new SqlConnection(); myCon.ConnectionString = "Data Source=.;Initial Catalog=数据库名;Integrated Security=True"; myCon.Open(); //使用SqlCommand SqlCommand C...

asp网站调试解决

sql = "select * from content where name like '%"&"复古"&"%' order by id asc"

select * form cms_admin where Instr(a_qx, "g")>0 用包含某字符查询

SQL语句直接执行就可以了: select count(*) as mycount from d_data where l_dn='name:wang' 同样 select count(*) as mycount2 from d_data where l_dn='name:li'

网站首页 | 网站地图
All rights reserved Powered by www.cwlr.net
copyright ©right 2010-2021。
内容来自网络,如有侵犯请联系客服。zhit325@qq.com