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

Sql基本语句的学习

--查询每个人订饭的次数
select  username as 姓名, count(*) as 次数 from orderitems  group by UserName having count(*)=1
order by 姓名 desc
select distinct username as 未注册姓名 from orderitems
where username not in (select [Name] from Person)
select distinct username as 已注册姓名 from orderitems where username
in (select [Name] from Person)
--索引为31-40的数据
select top 10 * from orderitems where ID not in (select top 30 ID from orderitems)
--复制数据
insert into  distinctselect(UserName,State,OrderTime) select UserName,State,OrderTime from orderitems
--去除所有重复的记录(完全重复)
select distinct UserName ,ID, State,OrderTime into #Table1 from [distinctselect]
delete from [distinctselect]
insert into [distinctselect](UserName,State,OrderTime) select UserName,State,OrderTime from #Table1
drop table #Table1
--删除某列重复的记录
delete   t  
  from   [distinctselect]   t  
  where   exists   (  
  select   1   from   [distinctselect]  where   username=t.username   and   id<t.id) 
select * from [distinctselect] order by username
delete from [distinctselect]


相关文档:

SQL Server 2000数据库的定时备份设置

利用SQL2000的定时备份功能,能很好对服务器上的重要数据信息进行完整的定时备份,以便在服务器瘫痪或数据库出现损坏时及时的进行恢复工作,以确保平时的工作能正常的进行。下面向大家介绍一下SQL2000定期备份的设置方法,具体如下:
1.         打开SQL2000的企业管理器
2.&nbs ......

讲解SQL Server数据库被挂马的解决方案

讲解SQL Server数据库被挂马的解决方案
http://www.cnhacker.com/Security/Plan/200808/t20080822_6383.html
案例:一个网站遭遇入侵,破坏相当严重,SQL数据库被挂马,所有的表里面大部分字段都被多次重复插入挂马代码,查看日志,还好没有涉及到服务器的安全,只是数据库那里出现了很多异常警告而已,网站确实存在漏洞 ......

SQL命令查询视图定义语句

用SQL命令查询视图定义语句,可以用以下两种方法:
sp_helptext '视图名' --多行显示
SELECT text from sysobjects so INNER JOIN syscomments sc ON so.id=sc.id  WHERE so.id=OBJECT_ID('视图名')--单行显示
......

SQL语句导入导出大全

这是《VC++动态链接库(DLL)编程深入浅出》的第四部分,阅读本文前,请先阅读前三部分:(一)
、(二)
、(三)

  MFC扩展DLL的内涵为MFC的扩展,用户使用MFC扩展DLL就像使用MFC本身的DLL一样。除了可以在MFC扩展DLL的内部使用MFC以外,MFC扩展DLL与应用程序的接口部分也可以是MFC。我们一般使用MFC扩展DLL来包含 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号