易截截图软件、单文件、免安装、纯绿色、仅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 ......

linq 获取数据库时间 或者执行其他带返回值的sql查询

 using (LongXingDBDataContext db = new LongXingDBDataContext())
             {
                 DeviceInfo di;
        ......

黑客攻破SQL服务器系统的十种方法

无论是使用手工试探还是使用安全测试工具,恶意攻击者总是使用各种诡计从你的防火墙内部和外部攻破你的SQL服务器系统。既然黑客在做这样的事情。你也需要实施同样的攻击来检验你的系统的安全实力。这是理所当然的。下面是黑客访问和攻破运行SQL服务器的系统的十种诡计。
1.通过互联网直接连接
这些连接可以用来攻击没有防 ......

C# 编写SQL SERVER 2005 的存储过程


以下是一个查询IP地址归属地的CLR存储过程,三步:
1、用C#来做DLL,代码如下:
//====================================================================
using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlTypes;
using System.Data.SqlClient;
using Microsoft.Sq ......

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号