_覓 | 覦覈襦 | 豕蠏手 | 殊螳 | 譯殊碁 |
FrontPage › 覓語Bit一磯語
|
|
[edit]
1 覓語 #る 磯殊 覩語 讌覓語 殊. 蠍一覲螻 Bit一一 蟯 覓語襦 DBMS れ 豬渚 覿覿願鍵 覓語 覓語襯 企慨. 讌覓語 れ螻 螳. (覓: http://www.devpia.com/Maeul/Contents/Detail.aspx?BoardID=41&MAEULNo=17&no=4619&ref=4619)
[edit]
2 #/* drop table #temp create table #temp(seq int, a varchar(30), b varchar(30)) insert #temp values(1, '1001' , '0101') insert #temp values(2, '10011' , '01011') */ with dumy(num) as ( select 0 num union all select num + 1 from dumy where num + 1 <= 30 ), rs (seq, a, b, rs) as ( select a.seq , a.a , a.b , b.rs from #temp a cross apply ( select case when '1' in (substring(a.a, num+1, 1), substring(a.b, num+1, 1)) then '1' else '0' end rs from dumy where num <= case when len(a.a) > len(a.b) then len(a.a) else len(a.b) end - 1 ) b ) select distinct seq , a , b , (select cast(rs as varchar(100)) as 'text()' from rs where a.seq = seq for xml path('')) [a | b] from rs a [edit]
3 覲旧″伎 伎螳 覘蟾? #企ゼ 覲企 譬 覲旧″る 螳 蟆企. 螳 覲願鍵 伎 蟆 . 覃 覓語 豌願 DBMS 轟煙 螻ろ讌 蠍 覓語企. 危襴貅伎 Bit一一 襷 暑. 覓朱 朱朱 DBMS Bit一磯 暑. '1101'螻 螳 覓語伎 13企朱 襯 蠏語 Bit一一 る 覲旧″讌 訖 觜 覈 豌覦(伎覃 覈 襷覦 伎) 渚 蟆企. 讀, れ螻 螳 蟆企.
讀, 13, 5 螳 企 SQL Server OR Bit一一 れ螻 螳 蟆企. select 13|5 [edit]
4 るジ #--drop table #temp create table #temp(id int, col1 varchar(30), col2 varchar(30)) insert #temp values(1, '1001' , '0101') insert #temp values(2, '10011' , '01011') ;with dummy(seq) as ( select 1 seq union all select seq + 1 from dummy where seq + 1 <= 30 ), result as ( select a.id , a.col1 , a.col2 , sign(convert(tinyint, substring(col1, seq, 1)) + substring(col2, seq, 1)) rs from #temp a cross join dummy b where b.seq <= len(a.col1) ) select id , x [col1 | col2] from #temp a cross apply ( select ( select cast(rs as varchar(100)) as 'text()' from result where a.id = id for xml path('')) x ) b
鏤
|
磯ゴ 覯 讌 覈詩 譬 讌螳 . (襴ろ) |