2008年10月小记(SQL删除重复记录,生成表结构,字符串特性,statistics io)
2008-10-07 10:23
369 查看
1、删除某字段中的重复记录,Table1006表中有Id和Phone字段,Id为不重复的标字段,但是Phone含有重复字段,现在需要重复Phone记录行删除掉,只保留最新一条记录。
4、statistics io
set statistics io on
set statistics io off
static void Main(string[] args) { string strA = "abcdef"; string strB = "abcdef"; Console.WriteLine(ReferenceEquals(strA, strB));//字符串的恒定性 string strC = "abc"; string strD = strC + "def"; Console.WriteLine(ReferenceEquals(strA, strD));//对于动态生成的字符串,字符串驻留机制失效 strD = String.Intern(strD); Console.WriteLine(ReferenceEquals(strA, strD));//使用Intern静态方法,能强制把字符串添加到哈希表中,并返回引用,便可以使字符串驻留。 string strE = "abc" + "def"; Console.WriteLine(ReferenceEquals(strA, strE));//使用+号,编译器会自动将其连接为一个文本常量加载,因此会添加到内部哈希表中。 //不同的线程、进程、AppDomain中字符串驻留都有效 System.Threading.Thread thread = new System.Threading.Thread(delegate(object str) { string strF = "abc" + "def"; Console.WriteLine(ReferenceEquals(str, strF)); }); thread.Start(strA); thread.Join(); string strG = strC + "def"; System.Threading.Thread thread2 = new System.Threading.Thread(delegate(object str) { string strF = "abc" + "def"; Console.WriteLine(ReferenceEquals(str, strF)); }); thread2.Start(strG); thread2.Join(); Console.ReadLine(); //result: //True //False //True //True //True //False }
4、statistics io
set statistics io on
set statistics io off
相关文章推荐
- 2008年10月小记(SQL删除重复记录,生成表结构,字符串特性,statistics io)
- 几个删除重复记录的SQL语句!
- Sql server 删除重复记录的SQL语句
- 【转】SQL删除某些字段重复的记录(只保留一条)
- SQL删除数据库中重复的数据记录
- sql查询重复记录、删除重复记录方法大全
- sql 删除重复记录
- SQL重复记录处理(查找,过滤,删除)
- sql删除表中重复记录只保留一条记录
- SQL查询或删除数据库中重复记录
- Oracle 查询并删除重复记录的SQL语句
- 四种方法教你如何用SQL语句删除重复记录
- sql删除重复记录
- SQL 删除重复记录
- 查询并删除重复记录的SQL语句 (示例)
- sql查询重复记录、删除重复记录方法大全
- 如何用SQL删除重复记录
- sql2005,删除某个字段重复的记录,随机留下一条记录
- sql查询重复记录、删除重复记录方法大全
- 如何使用Oracle查询并删除重复记录的SQL语句