易截截图软件、单文件、免安装、纯绿色、仅160KB

sql存储过程读取信息中问题

sql="select * from (select top 4 ID,SmallPic,NewsNameSi,EndDate,ContentSi,SortID from achi_news where ProductProperty=1 and IsOk=1 and HomeForcePage=1 and HomeEndTime>getDate() and isdate(HomeEndTime)=1 order by HomeorderNum asc  )a union all select * from (select top 4 ID,SmallPic,NewsNameSi,EndDate,ContentSi,SortID from achi_news where  ProductProperty=1 and IsOk=1 and Id not in (select top 4 ID from achi_news where ProductProperty=1 and IsOk=1 and HomeForcePage=1 and HomeEndTime>getDate() and isdate(HomeEndTime)=1 order by HomeorderNum asc) order by Enddate asc)b"
   'set rs=getRsBySql(sql)
   set rs=getStoredProcBySql(sql)
   对ID,SmallPic,NewsNameSi,EndDate,ContentSi,SortID 这个几个字段必须按查询时的顺序读取,否则未按顺序读取的字段不能正确显示!


相关文档:

oracle中sql语句中的in的条件数量大于1000有问题

oracle中sql语句中select * from t_Test t where  t.Id in(1,2,3......)/*数量不能大于1000个*/
解决方法 分割成多次in 然后再或上  如 select * from t_Test t where  t.Id in(1,2,3......800) or  t.Id in(801,802,803......1300)
在使用中最好能不使用其他条件来代替in
......

如何查询SQL Server备份还原历史记录

SQL Server在msdb数据中维护了一系列表,用来存储执行所有备份和还原的细节信息。即使你正在使用第三方的备份应用程序,只要这个应用程序使用SQL Server的虚拟设备接口(Virtual Device Interface---VDI)来执行备份和还原执行,那么执行细节依然被存储在这一系列表中。
存储细节的表包括:
backupset 
backupfile&n ......

SQL经典面试题及答案

1.一道SQL语句面试题,关于group by
表内容:
2005-05-09 胜
2005-05-09 胜
2005-05-09 负
2005-05-09 负
2005-05-10 胜
2005-05-10 负
2005-05-10 负
如果要生成下列结果, 该如何写sql语句?
            胜 负
2005-05-09 2 2
2005-05-10 1 2
------ ......

SQL Server Compact不同版本的安装包(转)

2010-01-13 23:22
摘要:SQL Server Compact的安装包由三部分功能组成,并且区分CPU平台和操作系统平台,初学者往往不知道如何去区分它们。本文将对SQL Server Compact的安装包进行介绍,让你知道如何区分和选择它们。
如果你是使用Visual Studio 2005/2008开发.NET Compact Framework应用程序,并在程序中用到了SQL Serv ......

测试一下自己的SQL水平

 
create table Student(Sname varchar(10),Ssex varchar(5),Sage int,S# int)
insert into Student
select '夏亮','男','21','1004'
select '成平','男','20','1001' union all
select '王波','男','19','1002' union all
select '突然','女','19','1003'
 
create table Course(C# varchar(10),Cname v ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号