- 博客(13)
- 资源 (2)
- 收藏
- 关注
转载 怎样取得表中不存在月份数据?
--测试数据declare @T table(yd varchar(10),rs int)insert @Tselect 2006-1,5 union allselect 2006-2,8 union allselect 2006-5,10 union allselect 2006-8,3 union allselect 2006-12,10select top 12 mon=
2007-10-15 10:43:00
549
转载 java中文件操作大全
本文为本人在工作学习中的总结,每个方法都经过测试,记在博客上一方面是为了自己日后工作方便,另一方面是为了给大家提供方便,节约时间。 一.获得控制台用户输入的信息/** *//**获得控制台用户输入的信息 * @return * @throws IOException */ public String getInputMessage() throws IO
2007-10-06 12:29:00
419
转载 转Javascript中最常用的55个经典技巧
1. oncontextmenu="window.event.returnValue=false" 将彻底屏蔽鼠标右键no 可用于Table2. 取消选取、防止复制3. onpaste="return false" 不准粘贴4. oncopy="return false;" oncut="return false;" 防止复制5. IE地址栏前换成自己的图标6.
2007-10-06 11:07:00
704
转载 关于如何只取得每组数据中的一个最大值的问题?
create table topic(Topicid int,title nvarchar(10),boardid int,addtime datetime )insert topic select 1, abc, 100, 2007-1-1 union all select 2, era, 101,
2007-10-01 13:38:00
988
转载 取这样的数据(a,b,c)变成(a代表的意思,b代表的意思,c代表的意思)方法
---创建测试环境 Create Table Tags(ID int,Name Varchar(20)) Insert Tags Select 1, Tag1 Union All Select 2, Tag2 Union All Select 3, Tag3 Union All Select 4, Ta
2007-10-01 11:05:00
788
转载 某外企SQL Server面试题(英文,答案)
Question 1:Can you use a batch SQL or store procedure to calculating the Number of Days in a Month Answer 1:找出当月的天数select datepart(dd,dateadd(dd,-1,dateadd(mm,1,cast(cast(year(getdate()) as varchar
2007-10-01 10:28:00
1454
转载 SQL 面试题
http://www.xiejianli.net/mianshiti/276/876.htm(转贴地址)假设只有一个table,名为pages,有四个字段,id, url,title,body。里面储存了很多网页,网页的url地址,title和网页的内容,然后你用一个sql查询将url匹配的排在最前,title匹配的其次,body匹配最后,没有任何字段匹配的,不返回。就是上面这道面试
2007-10-01 10:08:00
677
转载 left join使用精华:)
create table tt( id int identity(1,1), name varchar(10))insert ttselect a union allselect b union allselect ccreate table tt1( id int identity(1,1), name varchar(10))insert tt1select a u
2007-09-21 16:10:00
1629
1
转载 各位老大帮忙啊,季度汇总啊,怎么写啊,感谢
select 一季=sum(case when datepart(quarter, 日期)=1 then 金额 else 0 end),二季=sum(case when datepart(quarter, 日期)=2 then 金额 else 0 end),三季=sum(case when datepart(quarter, 日期)=3 then 金额 else 0 end),四季=sum(cas
2007-09-21 15:54:00
416
转载 检索z1中包含“ab”但不包含“ab1”的记录
有数据表T_table,其中有字段z1。z1存储由空格分隔的多个字符串,例如: 记录号 z1 1 ab1 df1 ft1 2 df1 ab1 ft1 3 df1 ft1 ab1 4 ab df1 ft1 5 df1 ab ft1 6 df1 ft1 ab 希望检索z1中包
2007-09-21 11:17:00
623
原创 删除以"temp"开头的所有表
declare @sql varchar(8000)set @sql=select @sql=@sql+,+name from sysobjects where type=U and name like temp%set @sql=drop table +stuff(@sql,1,1,) --去掉开头一个","exec(@sql)--例如:print @sql =dr
2007-09-21 11:04:00
821
原创 简单的最大最小问题:)
例表tb:id price netprice1 8.00 20.002 10.00 5.003 0.00 3.00 我想要查出price与netprice之间大的列比如查出如下数据:id newprice1 20.002 10.003 3.00sql语句要怎么写?Create Table tb(id Int, pric
2007-09-21 10:41:00
501
转载 1亿条数据中保留5条删除其他的有什么快点的方法:)
1、 select * into #test from table_Pqs where ...(5条记录) --先把5条数据导入临时表,这样的语句是表示连表结构也复制2、 truncate table table_Pqs --再把原表中数据truncate掉3、 Insert Into table_Pqs select * from #test --再把临时表中的数据导入表中4、 Drop ta
2007-09-21 10:30:00
760
1
ajax开发实例,设置中文,连接oracle数据库
2008-12-22
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人