![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SQL
ezbird
这个作者很懒,什么都没留下…
展开
-
SQL full join+自定义条件列
use testselect *from((select Col1,Col2 from Result where Col3='a')as T1(Col1,Col2_A)full join(select Col1,Col2 from Result where Col3=原创 2011-10-02 22:20:43 · 425 阅读 · 0 评论 -
SQL case关键字
Use testselect t2.col_1, sum(t2.col_a)as COL_A,sum(t2.col_b)as COL_B,sum(t2.col_c)as COL_Cfrom( select t.col_1, case t.name when 'a' t原创 2011-10-02 22:25:55 · 243 阅读 · 0 评论 -
SQL PIVOT关键字例
select *from(select Col1,Col2,Value from Result) as t1Col1 | Col2| Valuea 5 1a 4 -1b 5 3b原创 2011-10-02 22:43:16 · 282 阅读 · 0 评论 -
SQL游标使用例
Use [test]declare my_cur cursor for select name,Value from [Result]declare @s nchar(10)declare @a floatdeclare @c floatopen my_cur原创 2011-10-02 22:09:48 · 200 阅读 · 0 评论 -
SQL用例:convert(),while,Dateadd()
use [Test]delete [DateString]insert into [DateString] values('asdf',convert(datetime,'1990-12-19'),0)declare @i intset @i=1while原创 2011-10-10 14:51:32 · 201 阅读 · 0 评论