zoukankan
html css js c++ java
SQL语句
private
string
GetSQL()
{
string
strSQL;
//
strSQL = "select UID,MobileNum,DateTime,PayFlag,grade from SMS_Log where ";
strSQL
=
"
select UID,MobileNum,DateTime,PayFlag=case PayFlag when 0 then '未处理' when 1 then '成功扣费' when 2 then '扣费失败' end,grade=case grade when 0 then '未获奖' when 1 then '一等奖' when 2 then '二等奖' when 3 then '三等奖' end from SMS_Log where
"
;
strSQL
+=
"
1=1
"
;
//
什么都不选的情况
if
(tbUID.Text
!=
""
)
{
strSQL
+=
"
and
"
;
strSQL
+=
"
UID=N'
"
+
tbUID.Text.Trim()
+
"
'
"
;
//
选择用户ID的情况
}
if
(tbBeginTime.Value
!=
""
)
{
strSQL
+=
"
and
"
;
strSQL
+=
"
DateTime>'
"
+
tbBeginTime.Value
+
"
'
"
;
//
选择起始时间的情况,格式2005-4-27 17:33:04
}
if
(tbEndTime.Value
!=
""
)
{
strSQL
+=
"
and
"
;
strSQL
+=
"
DateTime<'
"
+
tbEndTime.Value
+
"
'
"
;
//
选择结束时间的情况
}
if
(cblSelect.SelectedIndex
==
0
)
{
strSQL
+=
"
and
"
;
strSQL
+=
"
PayFlag=1
"
;
//
选择成功扣费的情况,单选
}
if
(cblSelect.SelectedIndex
==
1
)
{
strSQL
+=
"
and
"
;
strSQL
+=
"
PayFlag=2
"
;
//
选择扣费失败的情况,单选
}
if
(cblSelect.SelectedIndex
==
2
)
{
strSQL
+=
"
and
"
;
strSQL
+=
"
PayFlag=0
"
;
//
选择未处理的情况,单选
}
return
strSQL;
}
查看全文
相关阅读:
redis持久化,主从及数据备份
验证redis的快照和AOF
Erlang中日志管理
erlang tcp发包速度测试
树(234树插入查找显示)
JDBC(初步试用)
树(二叉树的插入删除查找遍历)
哈希表(链地址法插入删除)
哈希表-再哈希法插入删除
哈希表-线性探测插入删除
原文地址:https://www.cnblogs.com/xiaodi/p/148228.html
最新文章
SQLHelper 工具类的使用
读取二进制大对象
Sql注入攻击
插入 删除和更新数据
C#字符串(string)的常用方法
C#抽象类
C#多态
C#继承
C#static(静态的)
C#类,对象,构造方法
热门文章
C#数组
HTML元素的定位
元素的浮动和清空浮动
HTML表单控件
[转至云风的博客]谈谈陌陌争霸在数据库方面踩过的坑( Redis 篇)
Redis+Mysql模式和内存+硬盘模式的异同
Redis与Memcached的区别
浅谈 Redis 与 MySQL 的耦合性以及利用管道完成 MySQL 到 Redis 的高效迁移
Redis 集群方案
Redis经验谈
Copyright © 2011-2022 走看看