惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

aimingoo的专栏
aimingoo的专栏
Google DeepMind News
Google DeepMind News
S
SegmentFault 最新的问题
Project Zero
Project Zero
D
DataBreaches.Net
I
InfoQ
L
Lohrmann on Cybersecurity
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
酷 壳 – CoolShell
酷 壳 – CoolShell
Stack Overflow Blog
Stack Overflow Blog
The Register - Security
The Register - Security
Recorded Future
Recorded Future
Vercel News
Vercel News
博客园 - 司徒正美
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
I
Intezer
The Hacker News
The Hacker News
F
Fortinet All Blogs
Microsoft Azure Blog
Microsoft Azure Blog
P
Proofpoint News Feed
Help Net Security
Help Net Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Scott Helme
Scott Helme
T
Threatpost
爱范儿
爱范儿
N
Netflix TechBlog - Medium
D
Docker
云风的 BLOG
云风的 BLOG
C
Cisco Blogs
K
Kaspersky official blog
H
Help Net Security
S
Secure Thoughts
T
Threat Research - Cisco Blogs
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
Security @ Cisco Blogs
Cyberwarzone
Cyberwarzone
N
News and Events Feed by Topic
G
Google Developers Blog
Forbes - Security
Forbes - Security
博客园 - 三生石上(FineUI控件)
博客园 - 叶小钗
B
Blog
Google DeepMind News
Google DeepMind News
Recent Announcements
Recent Announcements
Simon Willison's Weblog
Simon Willison's Weblog
S
Securelist
P
Privacy International News Feed
Spread Privacy
Spread Privacy
The Last Watchdog
The Last Watchdog

博客园 - 网际飞狐

异步服务框架 如何在TFS中用命令行提交更新 CollabNet Subversion 输出自定义日期格式 - 网际飞狐 - 博客园 你正确关闭WCF链接了吗? 通过OperationContext添加消息头信息 PHP在II7安装指南 [Google App Engine] Hello, world! 在IIS7中配置使用Python 2008年12月小记(NewSequentialID(),ADO.NET Data Service,Visual Studio Tips,安装Django,JQuery智能感知) [OpenAPI] html标签分析 System.Web.Routing 使用基础 Notes for 2008-11(GetRange, backup,file hash, PostRequest, QueryString) JS通过服务代理调用跨域服务 对硬编码WCF服务的封装(提供服务和客户端调用的封装,调用样例....) Observer Pattern, Delegate and Event How to view the W3WP process by c#? 项目框架概要 WinDbg使用摘要
2008年10月小记(SQL删除重复记录,生成表结构,字符串特性,statistics io)
网际飞狐 · 2008-10-07 · via 博客园 - 网际飞狐

1、删除某字段中的重复记录,Table1006表中有Id和Phone字段,Id为不重复的标字段,但是Phone含有重复字段,现在需要重复Phone记录行删除掉,只保留最新一条记录。

    if OBJECT_ID('dbo.Table1006'is not null
        
drop table dbo.Table1006
    
create table dbo.Table1006
    (
        
[Id] int,
        
[Phone] varchar(10)
    )
    
insert into dbo.Table1006 values(1100)
    
insert into dbo.Table1006 values(2110)
    
insert into dbo.Table1006 values(3120)
    
insert into dbo.Table1006 values(4130)
    
insert into dbo.Table1006 values(5110)
    
insert into dbo.Table1006 values(6110);
    
insert into dbo.Table1006 values(7120);
    
    
delete from dbo.Table1006 
        
where [Id] not in ( select  max([Id]as [Id] 
            
from dbo.Table1006 
            
group by [Phone])
    
select * from dbo.Table1006drop table dbo.Table1006


2、 生成表结构(可贴到Excel)方便编辑。

T-SQL

运行SQL语句,然后把Messages贴到Excel中就能方便的对结构进行编辑了。

3、字符串特性。
字符串具有恒定性、字符串驻留(跨AppDomain)、参数传递的特殊性。

Code

4、statistics io
set statistics io on 
set statistics io off