asp多条件查询sql语句用法,可用于搜索、筛选模块
分类:程序开发 Tags: asp 评论:0 浏览:2580 最近更新时间:2006/12/2 20:15:18
多条件查询sql语句用法,比较不错的多条件查询asp代码写法,很实用,也很简洁。
- big_id=trim(request("big_id"))
- small_id=trim(request("small_id"))
- key=trim(request("key"))
- yongtu=trim(request("yongtu"))
- chudian=trim(request("chudian"))
- dianliu=trim(request("dianliu"))
- dianya=trim(request("dianya"))
- Set Rs=Server.CreateObject("ADODB.Recordset")
- sql="select * from yuzhiguo_products where 1=1"
- if big_id<>"" then sql=sql&" and big_id="&big_id&""
- if small_id<>"" then sql=sql&" and small_id="&small_id&""
- if yongtu<>"" then sql=sql&" and yongtu="&yongtu&""
- if chudian<>"" then sql=sql&" and chudian="&chudian&""
- if dianliu<>"" then sql=sql&" and dianliu="&dianliu&""
- if dianya<>"" then sql=sql&" and dianya="&dianya&""
- if key<>"" then sql=sql&" and ( e_cpmc like '%"&key&"%') "
- sql=sql&" order by "&paixu&" desc,id desc"
本文地址:/93/
-
• ASP随机读取数据库中几条数据代码
• MySQL报Field‘***’doesn’t have a default value错误的解决办法
• UEditor百度编辑器在html代码模式无法更新内容的解决办法
• 打开网页自动弹出QQ对话框代码
• .htaccess中的apache rewrite规则写法详解
• asp中判断一个字符是不是汉字
• 支持中文转换的Asp UrlDecode函数
• ASP生成静态页面HTML的方法
• 一个空间/虚拟主机放置多个网站的转向代码(多个域名绑定一个空间)
• Asp超精准判断客户端操作系统类型代码