2018年萬金石馬
近期跑的最辛苦的馬,變步兵又曬傷,還一度想棄賽~
前半馬陰天無風很好跑,但後半出大太陽才是重頭戲,
先是水站缺水杯,又遇缺水,
21K約花2.5H,但在28K速度就HOLD不住了
抽筋也是免不了的,約在32K慘案發生,
5小時是不可能了,只求無傷完賽,
走走停停,當欣賞風景囉!
PS1.顏值高的馬尾妹真多
PS2.配速員:戴2016大阪馬帽的馬尾妹,感謝有您
PS3.第一次沒帶手機在身上,解放的感覺真好
避免Excel開啟CSV時截掉左補零的小工具
http://blog.darkthread.net/post-2012-04-12-keep-csv-leading-zeros-in-excel.aspx
最大群組關聯
近期遇到最難的邏輯
if object_id('tempdb..#IL_Benson') is not null drop table #IL_Benson ; create table #IL_Benson ( ActSeq varchar(19) --18 , GCNo varchar(21) --21 , ActSeq_T varchar(19) , GCNo_T varchar(21) , RUN int default 0) ; insert into #IL_Benson (ActSeq, GCNo) values ('ACT1', 'A') , ('ACT2', 'B'), ('ACT2', 'C'), ('ACT2', 'D') , ('ACT3', 'A'), ('ACT3', 'C') , ('ACT4', 'D') , ('ACT5', 'D'), ('ACT5', 'E') , ('ACT6', 'F'), ('ACT6', 'G') , ('ACT7', 'F') , ('ACT8', 'G'), ('ACT8', 'H') , ('ACT9', 'Z') /* update a set a.RUN = 0 , a.ActSeq_T = null , a.GCNo_T = null from #IL_Benson a select a.ActSeq, a.GCNo, a.ActSeq_T, a.GCNo_T, a.RUN from #IL_Benson a order by 1, 2 */ --資料檢測,RUN<0 --(RUN=-1) 1 ACT to 1 GC update a set a.ActSeq_T = a.ActSeq , a.GCNo_T = a.GCNo , a.RUN = -1 from #IL_Benson a inner join ( select a.ActSeq, count(distinct a.GCNo) CNT from #IL_Benson a group by a.ActSeq having count(distinct a.GCNo) = 1 ) b on a.ActSeq = b.ActSeq inner join ( select a.GCNo, count(distinct a.ActSeq) CNT from #IL_Benson a group by a.GCNo having count(distinct a.ActSeq) = 1 ) c on a.GCNo = c.GCNo ; --(RUN=-2) 1 ACT to Multi GC and 1 GC to 1 ACT update a set a.ActSeq_T = a.ActSeq , a.GCNo_T = b.GCNo_T , a.RUN = -2 --select count(*) from #IL_Benson a inner join ( select a.ActSeq, count(distinct a.GCNo) CNT, min(a.GCNo) GCNo_T from #IL_Benson a group by a.ActSeq having count(distinct a.GCNo) > 1 ) b on a.ActSeq = b.ActSeq inner join ( select b.ActSeq, count(distinct a.ActSeq) cnt from #IL_Benson a inner join ( select a.ActSeq, a.GCNo from #IL_Benson a inner join ( select a.ActSeq, count(distinct a.GCNo) CNT from #IL_Benson a group by a.ActSeq having count(distinct a.GCNo) > 1 ) b on a.ActSeq = b.ActSeq ) b on a.GCNo = b.GCNo group by b.ActSeq having count(distinct a.ActSeq) = 1 ) c on a.ActSeq = c.ActSeq where a.ActSeq_T is null and a.GCNo_T is null ; --(RUN=-3) 1 ACT to 1 GC and 1 GC to Multi ACT update a set a.ActSeq_T = b.ActSeq_T , a.GCNo_T = a.GCNo , a.RUN = -3 --select count(*) from #IL_Benson a inner join ( select a.GCNo, count(distinct a.ActSeq) CNT, min(a.ActSeq) ActSeq_T from #IL_Benson a group by a.GCNo having count(distinct a.ActSeq) > 1 ) b on a.GCNo = b.GCNo inner join ( select b.GCNo, count(distinct a.GCNo) cnt from #IL_Benson a inner join ( select a.ActSeq, a.GCNo from #IL_Benson a inner join ( select a.GCNo, count(distinct a.ActSeq) CNT from #IL_Benson a group by a.GCNo having count(distinct a.ActSeq) > 1 ) b on a.GCNo = b.GCNo ) b on a.ActSeq = b.ActSeq group by b.GCNo having count(distinct a.GCNo) = 1 ) c on a.GCNo = c.GCNo where a.ActSeq_T is null and a.GCNo_T is null ; --select * from #IL_Benson -------------------------------------- --補衍伸關聯資料,RUN=1 DECLARE @RC INT DECLARE @RUN INT select @RC = count(*) --select count(*) from #IL_Benson a where a.ActSeq_T is null WHILE @RC > 0 BEGIN SET @RC = 0 insert into #IL_Benson (ActSeq, GCNo, RUN) select distinct b.ActSeq_T ActSeq, a.GCNo, 1 from #IL_Benson a inner join ( select distinct b.ActSeq ActSeq_T, a.ActSeq, b.GCNo from #IL_Benson a inner join ( select distinct a.ActSeq, a.GCNo from #IL_Benson a where a.ActSeq_T is null --and a.ActSeq = '3' ) b on a.GCNo = b.GCNo ) b on a.ActSeq = b.ActSeq left outer join #IL_Benson c on b.ActSeq_T = c.ActSeq and a.GCNo = c.GCNo and c.ActSeq_T is null where a.ActSeq_T is null and c.ActSeq is null set @RC = @RC + @@ROWCOUNT --select * from #IL_Benson where Run=1 insert into #IL_Benson (ActSeq, GCNo, RUN) select distinct a.ActSeq, b.GCNo_T GCNo, 1 from #IL_Benson a inner join ( select distinct b.GCNo GCNo_T, b.ActSeq, a.GCNo from #IL_Benson a inner join ( select distinct a.ActSeq, a.GCNo from #IL_Benson a where a.ActSeq_T is null --and a.GCNo = 'D' ) b on a.ActSeq = b.ActSeq ) b on a.GCNo = b.GCNo left outer join #IL_Benson c on a.ActSeq = c.ActSeq and b.GCNo_T = c.GCNo and c.ActSeq_T is null where a.ActSeq_T is null and c.ActSeq is null set @RC = @RC + @@ROWCOUNT --select * from #IL_Benson where Run=1 --select a.RUN, count(*) --from #IL_Benson a --where a.ActSeq_T is null --group by a.RUN END update a set a.ActSeq_T = a.ActSeq , a.GCNo_T = a.GCNo from #IL_Benson a where a.ActSeq_T is null and a.GCNo_T is null --select * from #IL_Benson order by ActSeq_T,GCNo_T -------------------------------------- declare @RC INT select @RC = count(*) from #IL_Benson a where a.RUN >= 0 --select @RC WHILE @RC > 0 BEGIN SET @RC = 0 update a set a.ActSeq_T = b.ActSeq --select count(*) from #IL_Benson a inner join ( select a.GCNo GCNo, min(a.ActSeq) ActSeq from #IL_Benson a where a.RUN >= 0 group by a.GCNo ) b on a.GCNo_T = b.GCNo and a.ActSeq_T <> b.ActSeq where a.RUN >= 0 SET @RC = @RC + @@ROWCOUNT update a set a.GCNo_T = b.GCNo --select count(*) from #IL_Benson a inner join ( select a.ActSeq ActSeq, min(a.GCNo) GCNo from #IL_Benson a where a.RUN >= 0 group by a.ActSeq ) b on a.ActSeq_T = b.ActSeq and a.GCNo_T <> b.GCNo where a.RUN >= 0 SET @RC = @RC + @@ROWCOUNT END --select * from #IL_Benson order by ActSeq,GCNo
GRIDVIEW的總筆數
https://dotblogs.com.tw/shadow/2011/07/24/32044
小技巧,可一個SQL搞定
寫入Linked Server遇到的問題
讀取遠端SP,將結果集收回本機,找到以下解法:
https://dotblogs.com.tw/abbee/2017/01/20/163135
原以為此問題只能用DTC設定解決,
但其實有OPENQUERY的方法可解
INSERT INTO #tmp --exec [10.11.36.52].[ELOANDB].dbo.SP_ONLINE_8888_TO_DW SELECT * FROM OPENROWSET('SQLOLEDB','IP,1433';'帳號';'密碼','SET FMTONLY OFF; EXEC DB.dbo.SP_NAME')
Windows 2012+IIS+NET4.5
http://slashlook.com/articles_20131205.html
http://blog.darkthread.net/post-2013-11-29-iis8-asp-net-setup.aspx
肥肥走了
不知是傳染病還是怎樣,在一個星期中一個個死亡。。。
雖有緊急換水和下藥,但似乎沒用,
算一算也18年了,是壽命到了嗎?
唉!肥肥一路好走。。。
我也剪了個大平頭祈禱肥肥安心上路。
在家庭會議後也決定不再養魚了,媽媽考量大家都太忙沒空也沒体力清理了,
若小孩出生後更是如此,或許3~4年後也會遇到養與不養的議題,現在就是個機會。