摘要: 在数据库中得到xml格式的数据select T1.ID ,T1.成人成本价 ,T1.成人市场价 from dbo.产品日期和价格 T1 FOR XML auto执行效果:点击执行结果,预览数据如下图:如果用FOR XML RAW 执行效果如: 阅读全文
posted @ 2013-04-12 14:01 翠儿 阅读(115) 评论(0) 推荐(0) 编辑
摘要: <html><head><title></title><style type="text/css">div{width:200px;word-break:break-all; border:1px solid red; overflow :hidden ; cursor:pointer; }</style><script type="text/javascript"> var t = true; var obj, a; function openclose(openclo 阅读全文
posted @ 2013-02-04 14:44 翠儿 阅读(549) 评论(0) 推荐(0) 编辑
摘要: create trigger T_P on 学生表 for delete as declare @学号 intselect @学号=deleted.学号from deletedprint '准备级联删除表二中的学生信息!'delete 成绩表where 成绩表.学号=@学号 阅读全文
posted @ 2013-01-23 14:10 翠儿 阅读(322) 评论(1) 推荐(0) 编辑
摘要: alter PROCEDURE 根据分类查主题111111111111 @类别ID int asbegin declare @id int set @id=@类别ID; with temp(idCategory,categoryRoot) --递归法 as( select 类别ID,根类别 from dbo.主题类别表 where 根类别=@id union all --Union,对两个结果集进行并集操作,不包括重复行,同时进行默认规则的排序Union All,对两个结果集进行并集操作,包括重复行,不进行排序; select 类别ID,根类别 from dbo.主题类别表... 阅读全文
posted @ 2013-01-21 18:12 翠儿 阅读(208) 评论(0) 推荐(0) 编辑
摘要: <tr align="center" class="list_L01" style='background-color: <%#(Container.ItemIndex%2==0)?"#FFFFF;":"#fcf3f4"%>' onmouseover="change_colorOver(this)" onmouseout="change_colorOut(this)"></tr> <input type="h 阅读全文
posted @ 2013-01-17 10:52 翠儿 阅读(572) 评论(0) 推荐(0) 编辑
摘要: <html><head><script type="text/javascript">function startTime(){var today=new Date()var h=today.getHours()var m=today.getMinutes()var s=today.getSeconds()// add a zero in front of numbers<10m=checkTime(m)s=checkTime(s)document.getElementById('txt').innerHTML=h+ 阅读全文
posted @ 2012-12-27 14:03 翠儿 阅读(588) 评论(3) 推荐(0) 编辑
摘要: STR() 把数值型数据转换为字符型数据。STR (<float_expression>[,length[, <decimal>]]) length 指定返回的字符串的长度,decimal 指定返回的小数位数。如果没有指定长度,缺省的length 值为10, decimal 缺省值为0。 当length 或者decimal 为负值时,返回NULL; 当length 小于小数点左边(包括符号位)的位数时,返回length 个*; 先服从length ,再取decimal ; 当返回的字符串位数小于length ,左边补足空格。一、去空格函数1、LTRIM() 把字符串头部 阅读全文
posted @ 2012-12-26 17:18 翠儿 阅读(264) 评论(0) 推荐(0) 编辑
摘要: 日期格式化View Code 1 lect CONVERT(varchar(100), GETDATE(), 0): 05 16 2006 10:57AM 2 Select CONVERT(varchar(100), GETDATE(), 1): 05/16/06 3 Select CONVERT(varchar(100), GETDATE(), 2): 06.05.16 4 Select CONVERT(varchar(100), GETDATE(), 3): 16/05/06 5 Select CONVERT(varchar(100), GETDATE(), 4): 16.05.06 6. 阅读全文
posted @ 2012-12-26 16:28 翠儿 阅读(521) 评论(0) 推荐(0) 编辑
摘要: Sql Server数据类型转换函数此类函数有两个:・CAST()CAST() 函数语法如下:CAST (<expression> AS <data_ type>[ length ])・CONVERT()CONVERT() 函数语法如下:CONVERT (<data_ type>[ length ], <expression> [, style])提醒: 1、data_type为SQL Server系统定义的数据类型,用户自定义的数据类型不能在此使用。2、length用于指定数据的长度,缺省值为30。3、把CHAR或VARCHAR类型转换为诸如I 阅读全文
posted @ 2012-12-26 16:25 翠儿 阅读(363) 评论(1) 推荐(0) 编辑
摘要: select*fromscore --剔除重复项 selectdistinct(score)fromscore --保留重复项(注意:withties必须和top...orderby一起使用) selecttop1withtiesscorefromscore orderbyscoredesc --newid() selectnewid()as'新ID',*fromscore --根据‘成绩’字段的降序排列生成‘行号’ selectrow_number()over(orderbyScoredesc)as'行号', stuIDas'学号',Score 阅读全文
posted @ 2012-12-26 15:24 翠儿 阅读(557) 评论(0) 推荐(0) 编辑
摘要: 1.建一张客户表,包含客户名称,联系人,电话号码,公司地址.2.建一张订单表,包含订单编号,客户ID,供应商ID,订单金额,客户支付状态,供应商支付状态,订单日期.3.建一张供应商表,包含供应商名称,联系人,电话号,供应商地址View Code 1 create table customer 2 ( 3 customerID int primary key identity(1,1) , 4 customerName varchar(50), 5 cuslinkMan varchar(50), 6 customerPhone varchar(12), 7 companyAdress var.. 阅读全文
posted @ 2012-12-25 16:23 翠儿 阅读(469) 评论(0) 推荐(1) 编辑
摘要: 查询的逻辑执行顺序FROM < left_table>ON < join_condition>< join_type> JOIN < right_table>WHERE < where_condition>GROUP BY < group_by_list>WITH {cube | rollup}HAVING < having_condition>SELECTDISTINCTORDER BY < order_by_list>< top_specification> < select_ 阅读全文
posted @ 2012-12-25 09:57 翠儿 阅读(293) 评论(0) 推荐(0) 编辑
摘要: 1.INSERT INTO SELECT语句语句形式为:Insert into Table2(field1,field2,...) select value1,value2,... from Table1 要求目标表Table2必须存在,由于目标表Table2已经存在,所以我们除了插入源表Table1的字段外,还可以插入常量。示例如下: 2.SELECT INTO FROM语句语句形式为:SELECT vale1, value2 into Table2 from Table1 要求目标表Table2不存在,因为在插入时会自动创建表Table2,并将Table1中指定字段数据复制到Table2. 阅读全文
posted @ 2012-12-24 17:54 翠儿 阅读(191) 评论(0) 推荐(0) 编辑
摘要: public class AppConstant中 #region 公告分类状态 public static Hashtable StatusHash = new Hashtable { {"0","全部"}, {"1","公司行规"},{"2","职场秘籍"},{"3","生活小提示"},{"4","电视剧场"},{"5","家庭影院"},{"6 阅读全文
posted @ 2012-12-24 10:54 翠儿 阅读(346) 评论(0) 推荐(0) 编辑
摘要: <script type="text/javascript">function getSelectedUsers() { var sltUser = ""; var arrSelect = document.getElementsByName("myCheckBox"); for (i = 0; i < arrSelect.length; i++) { if (arrSelect[i].checked) { sltUser += arrSelect[i].value + ","; i[0]+=1; 阅读全文
posted @ 2012-12-24 10:30 翠儿 阅读(117) 评论(0) 推荐(0) 编辑