如何连接判断字符新方法,如:where id0 and username="" and ......2006-6-8-3
来源:互联网 发布:淘宝网怎么改密码找回 编辑:程序博客网 时间:2024/05/16 05:02
sql="select * from tables where id<>0 "
if uid<>"" then sql=sql&" and uid=1 "
if uid2<>"" then sql=sql&" and uid2=1 "
if uid3<>"" then sql=sql&" and uid3=1 "
上边的连接是大家常用到的,下边是针对排序的.
if uid="1" then ostr=ostr&" ,uid desc "
if uid="2" then ostr=ostr&" ,uid "
if uid2="1" then ostr=ostr&" ,uid2 desc "
if uid2="2" then ostr=ostr&" ,uid2 "
if uid3="1" then ostr=ostr&" ,uid3 desc "
if uid3="2" then ostr=ostr&" ,uid 3 "
ostr=mid(ostr,1) '这一步的作用是,以前的取排序操作字段的时候没有考虑:这个字段前边是不是已经有一个了,现在不用考虑,直接写到最后把前边的那个", "用mid去掉就行
if len(trim(ostr))<>0 then
sql=sql&" order by "&ostr
end if
- 如何连接判断字符新方法,如:where id0 and username="" and ......2006-6-8-3
- MySQL查询优化:LIMIT 1避免全表扫描【如判断用户是否存在select * from users where username='123' and passwd='123' limit 1】
- HIbernate login this.hibernateTemplate.find("from User where username=? and password=?",new Object[
- String整合Hibernate Hql出现user is not mapped [FROM USER WHERE username =? and password=?
- Difference between "su - $username" and "su $username"
- Java获取uri and ?username=tom&age=22
- ibatIS的<dynamic prepend="WHERE">原理,是判断前一个AND字母是否存在
- join and PK where and
- 左连接 A left join B on A.a = B.a and/where的区别
- 左右连接中where和and的区别
- MYSQL 表连接 ON AND 和ON WHERE 的区别
- where and having
- where and or
- Join and Where
- SQL WHERE & AND & OR
- Get username and password for sina weibo
- tomcat - set up username and password
- git svn 修改提交username and password
- C#调用声音函数(PlaySound,Beep,MessageBeep等)
- IIS操作类
- Windows自启动程序十大藏身之所
- net] asp.net2.0的中国农历日期类
- 我在你记忆中的印象是什么样的?
- 如何连接判断字符新方法,如:where id0 and username="" and ......2006-6-8-3
- 未来的火影-sand_of_Sitsang出场
- PHP 正则表达式资料
- 设置emacs的默认字体
- 开发web应用难于上青天,web开发十八难
- IP 隧道技术:基础篇
- ultoa
- 巧用VBA自动处理Word表格
- 取汉字拼间首字母函数