<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[hello926的专栏]]></title><description><![CDATA[]]></description><link>https://blog.csdn.net/hello926</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; hello926]]></copyright><item><title><![CDATA[T-SQL中的ISNULL和IS NULL]]></title><link>https://blog.csdn.net/hello926/article/details/6039068</link><guid>https://blog.csdn.net/hello926/article/details/6039068</guid><author>hello926</author><pubDate>Sat, 27 Nov 2010 11:51:00 +0800</pubDate><description><![CDATA[<br />T-SQL中，有时判断一个变量是否为NULL时，有人可能会用到函数ISNULL，如： DECLARE @VAR1 VARCHAR(20)<br />DECLARE @VAR2 INT<br />IF ISNULL(@VAR1, '') = '' PRINT '@VAR1 is null.'<br />IF ISNULL(@VAR2, -1) = -1 PRINT '@VAR2 is null.'<br />这种用法其实是有问题的，再看： DECLARE @VAR1 VARCHAR(20)<br ]]></description><category></category></item><item><title><![CDATA[pivot]]></title><link>https://blog.csdn.net/hello926/article/details/6031890</link><guid>https://blog.csdn.net/hello926/article/details/6031890</guid><author>hello926</author><pubDate>Wed, 24 Nov 2010 12:55:00 +0800</pubDate><description><![CDATA[<br />WITHTEMPAS<br />(<br />    SELECTTOP3 ROW_NUMBER() OVER(ORDERBY[Title]) AS[Row_Num],[Title]<br />    FROM[Message]<br />)<br />SELECT*FROMTEMP<br />pivot(<br />    max(title)<br />for Row_Num in([1],[2],[3])<br />)p<br /><br /><br />1    2    3<br />]]></description><category></category></item><item><title><![CDATA[根据 性别 字段 间隔排序 。。。。]]></title><link>https://blog.csdn.net/hello926/article/details/6029832</link><guid>https://blog.csdn.net/hello926/article/details/6029832</guid><author>hello926</author><pubDate>Tue, 23 Nov 2010 15:02:00 +0800</pubDate><description><![CDATA[<br />根据 性别 字段 间隔排序 。。。。<br /><br />一个男 一个女 。。。再一个男一个 女 。而且 根据时间排序 <br /> <br /> <br />createtable tb(bsex varchar(2),dt datetime)<br />insertinto tb values('男','2010-11-01')<br />insertinto tb values('男','2010-11-02')<br />insertinto tb values('女','2010-1]]></description><category></category></item><item><title><![CDATA[用什么方法查询IP数据库]]></title><link>https://blog.csdn.net/hello926/article/details/6029787</link><guid>https://blog.csdn.net/hello926/article/details/6029787</guid><author>hello926</author><pubDate>Tue, 23 Nov 2010 14:50:00 +0800</pubDate><description><![CDATA[<br />http://topic.csdn.net/u/20101122/13/7a4c0fbc-df05-4399-9c33-299e1abfc590.html?seed=1271206866&r=70079033#r_70079033  原贴地址]]></description><category></category></item><item><title><![CDATA[分隔字段]]></title><link>https://blog.csdn.net/hello926/article/details/6023387</link><guid>https://blog.csdn.net/hello926/article/details/6023387</guid><author>hello926</author><pubDate>Sat, 20 Nov 2010 14:24:00 +0800</pubDate><description><![CDATA[<br />name value<br />----- -------<br />张三 1,2,3,4<br />李四 a,s,d,f,g<br />.......<br /><br />如何将上面的结果集转为下面的结果集：<br /><br />name value<br />----- -------<br />张三 1<br />张三 2<br />张三 3<br />张三 4<br />李四 a<br />李四 s<br />李四 d<br />李四 f<br />李四 g ifobject_id(]]></description><category></category></item><item><title><![CDATA[数据表中有字段time（类型为varchar），如何通过sql语句找出这个字段里力离当前最近的一个日期]]></title><link>https://blog.csdn.net/hello926/article/details/6023382</link><guid>https://blog.csdn.net/hello926/article/details/6023382</guid><author>hello926</author><pubDate>Sat, 20 Nov 2010 14:21:00 +0800</pubDate><description><![CDATA[<br />createtable tb(time datetime)<br />insertinto tb select'2010-10-25 22:10:30'unionallselect'2010-11-03 15:20:00'unionallselect'2010-12-15 11:11:11'<br />go<br />select*from tb a whereabs(datediff(s,getdate(),time))=(selectmin(abs(datediff(s,getdate(),]]></description><category></category></item><item><title><![CDATA[sqlserver FOR XML PATH 语句的应用]]></title><link>https://blog.csdn.net/hello926/article/details/6023376</link><guid>https://blog.csdn.net/hello926/article/details/6023376</guid><author>hello926</author><pubDate>Sat, 20 Nov 2010 14:18:00 +0800</pubDate><description><![CDATA[<br />http://www.jb51.net/article/23413.htm]]></description><category></category></item><item><title><![CDATA[请教如何把下面的数量 和 单位 区分开 ？ ]]></title><link>https://blog.csdn.net/hello926/article/details/6023371</link><guid>https://blog.csdn.net/hello926/article/details/6023371</guid><author>hello926</author><pubDate>Sat, 20 Nov 2010 14:16:00 +0800</pubDate><description><![CDATA[<br />4根 <br />1件 <br />1件 <br />1把 <br /> 20桶<br /> 1 <br />1件 <br />2件 <br />1箱 <br />70只<br /> 1件 <br /> 2㎡ <br />1台 <br /> 2台<br /> 500个 <br />1件 <br />300只<br /> 5只 2根<br /> 1000只<br /> 2件<br /> 1 <br />2只<br /> CREATEfunction dbo.F_Get_No<br />(<br /]]></description><category></category></item><item><title><![CDATA[SQL中STR()函数功能]]></title><link>https://blog.csdn.net/hello926/article/details/6023358</link><guid>https://blog.csdn.net/hello926/article/details/6023358</guid><author>hello926</author><pubDate>Sat, 20 Nov 2010 14:09:00 +0800</pubDate><description><![CDATA[<br />SQL中STR()函数功能 <br />declare @number smallint<br />set @number=2<br />select cast(replace(str(@number,3),' ','0') as char(3))<br />STR 函数 [字符串]<br />功能<br />返回一个数字的等效字符串。<br />语法<br />STR ( numeric_expression [, length [, decimal ] ] )<br />参数<br />nu]]></description><category></category></item><item><title><![CDATA[如何实现列转行呈现数据]]></title><link>https://blog.csdn.net/hello926/article/details/6023353</link><guid>https://blog.csdn.net/hello926/article/details/6023353</guid><author>hello926</author><pubDate>Sat, 20 Nov 2010 14:07:00 +0800</pubDate><description><![CDATA[<br />有数据表如下:<br />CheckMonth Count_SH Count_BJ Count_GZ<br />2010-04 1570 1350 750<br />2010-05 1840 1400 850<br />2010-06 1950 1580 890<br />如何呈现为:<br />CityCount 2010-04 2010-05 2010-06<br />Count_SH 1570 1840 1950<br />Count_BJ 1350 1400 1580<br />Coun]]></description><category></category></item><item><title><![CDATA[考试常考的SQL题目 ]]></title><link>https://blog.csdn.net/hello926/article/details/6023310</link><guid>https://blog.csdn.net/hello926/article/details/6023310</guid><author>hello926</author><pubDate>Sat, 20 Nov 2010 13:50:00 +0800</pubDate><description><![CDATA[<br />http://wenku.baidu.com/view/dd43994ae45c3b3567ec8b29.html]]></description><category></category></item><item><title><![CDATA[Sql Server 常用日期格式转换 ]]></title><link>https://blog.csdn.net/hello926/article/details/6023306</link><guid>https://blog.csdn.net/hello926/article/details/6023306</guid><author>hello926</author><pubDate>Sat, 20 Nov 2010 13:47:00 +0800</pubDate><description><![CDATA[<br />原著（地址）：http://www.cnblogs.com/benzhang/archive/2010/05/24/1743102.html<br />我们经常出于某种目的需要使用各种各样的日期格式，当然我们可以使用字符串操作来构造各种日期格式,但是有现成的函数为什么不用呢？ <br /><br />SQL Server中文版的默认的日期字段datetime格式是yyyy-mm-dd Thh:mm:ss.mmm <br /><br />例如: <br /><br />select getdate]]></description><category></category></item></channel></rss>