2013年2月26日
摘要: 大家首先会想到:distinct。有如下数据表A:id title grief1 标题1 简介12 标题2 简介23 标题1 简介34 标题2 简介2对于title字段,若实现重复数据只显示一条,可用如下sql语句:select distinct title from A但这样返回的只有一个title字段。扩展:如果要实现title字段重复数据只显示一条,并且要返回多个字段,使用distinct就不行了。以下sql语句解决以上问题。select * from A where id in (select min(id) from course group by title,grief)(这里mi 阅读全文
posted @ 2013-02-26 18:55 hanshuhe 阅读(45426) 评论(3) 推荐(2) 编辑
  2013年1月23日
摘要: SELECTCASESexWHEN1THEN'男' WHEN0THEN'女'END AS SexFROMUsers 阅读全文
posted @ 2013-01-23 10:09 hanshuhe 阅读(795) 评论(0) 推荐(0) 编辑
  2012年10月9日
摘要: 以往每次用Assembly.Load方法是,总是要查一次API,而且还要试验一小会。干脆写出来以后直接用Operation Oper = (OperationAdd)Assembly.Load("OperationAdd").CreateInstance("Calculator.OperationAdd");其中 Load("OperationAdd")中的OperationAdd事dll文件名称,即存在一个OperationAdd.dll的文件。").CreateInstance("Calculator.Oper 阅读全文
posted @ 2012-10-09 18:31 hanshuhe 阅读(5023) 评论(0) 推荐(0) 编辑
  2012年8月30日
摘要: 一、安装VSS(Visual SourceSafe) 下载安装(略)..... 二、建VSS 打开安装好的VSS,点击Browser,在新窗口中点击Add,则进入添加VSS的向导,点击Next,选择第二个“Create a new database”,next,再在Location里Browser你要放的此次建的VSS地址(比如:D盘某个目录),再next,输入你想命的名(比如:myVss),next,选择第一个“Lock-Modify-Unlock Model...”next,然后到finish就建好了。 接下来要让别人能连接你的VSS,就要将你刚建好的VSS(这里是myVss... 阅读全文
posted @ 2012-08-30 20:52 hanshuhe 阅读(7173) 评论(0) 推荐(0) 编辑
  2012年8月22日
摘要: 有时候在行编辑的时候,一个编辑框的值要根据其它编辑框的值进行变化,那么可以通过在开启编辑时,找到特定的Editor,为其添加事件function editrow(index) { if (rowedit == 0) { $('#ZCEditList').datagrid('beginEdit', index); rowedit = 1; var editors = $('#ZCEditList').datagrid('getEditors', index); var TonsEditor = editors[3]; var Hor 阅读全文
posted @ 2012-08-22 14:40 hanshuhe 阅读(11942) 评论(1) 推荐(0) 编辑
  2012年6月18日
摘要: 左连接 *=(左表中的数据全部显示出来,右表中没有相关联的数据显示null)select Users.*,Department.name as DepartmentName from Users,Department where users.DepartmentID*=Department.ID右链接 =* 阅读全文
posted @ 2012-06-18 08:00 hanshuhe 阅读(1559) 评论(0) 推荐(0) 编辑
  2012年4月28日
摘要: ALTER TRIGGER [dbo].[IsFull] ON [dbo].[BorrowBid] FOR UPDATEASdeclare @AlsoNeedAmount decimal(18,2)declare @GurantFlag intdeclare @AlsoNeedGurantAmount decimal(18,2)select @AlsoNeedAmount=AlsoNeedAmount,@GurantFlag=GurantFlag,@AlsoNeedGurantAmount=AlsoNeedGurantAmount from BorrowBid where BorrowBidI 阅读全文
posted @ 2012-04-28 15:10 hanshuhe 阅读(176) 评论(0) 推荐(0) 编辑
  2012年2月21日
摘要: 定义计时器 var timer = window.setInterval("fs()",1000);/取消计时器 clearInterval(timer)备注:注意变量timer的全局性,如果在某个函数中调用setInterval,在另外的函数中调用clearInterval,那么timer 应该声明为全局变量 阅读全文
posted @ 2012-02-21 19:58 hanshuhe 阅读(780) 评论(0) 推荐(0) 编辑
摘要: 当无意中点击浏览器的关闭按钮时,如果不给出提示就关闭,有些信息会丢失掉。下面的代码给出了提示。 阅读全文
posted @ 2012-02-21 19:48 hanshuhe 阅读(433) 评论(0) 推荐(0) 编辑
  2012年1月9日
摘要: 【程序代码】<asp:Repeater ID="Repeater1" runat="server"> <HeaderTemplate> <asp:Label ID="Label1" runat="server" Text="AAAAAAA"></asp:Label> </HeaderTemplate> <ItemTemplate> <asp:Label ID="Label2" runat=" 阅读全文
posted @ 2012-01-09 17:23 hanshuhe 阅读(867) 评论(0) 推荐(0) 编辑