我有一個名爲body
的列,其中包含我們CMS的正文內容。數據如下:SQL Server:字符串操作,Unpivoting
... {cloak:id = 1.1.1} ... {cloak} ... {cloak:id = 1.1.2} ... {cloak} ... {披風:ID = 1.1.3} ... {斗篷} ...
適度調整了可讀性,例如:
## h5. A formal process for approving and testing all external network connections and changes to the firewall and router configurations?
{toggle-cloak:id=1.1.1}{tree-plus-icon} *Compliance:* {color:red}{*}Partial{*}{color} (?)
{cloak:id=1.1.1} || Date: | 2010-03-15 || || Owner: | Brian || || Researched by: | || || Narrative: | Jira tickets are normally used to approve and track network changes\\ || || Artifacts: | Jira.bccampus.ca\\ || || Recommendation: | Need to update policy that no Jira = no change\\ || || Proposed Remedy(ies): | || || Approved Remedy(ies): | || || Date: | || || Reviewed by: | || || Remarks/comments: | ||
{cloak}## h5. Current network diagrams with all connections to cardholder data, including any wireless networks?
{toggle-cloak:id=1.1.2}{tree-plus-icon} *Compliance:* {color:red}{*}TBD{*}{color} (?)
{cloak:id=1.1.2}
我想獲得的外衣值出在以下格式:
requirement_num
-----------------
1.1.1
1.1.2
1.1.3
我正在尋找使用聯盟 - 有沒有人有更好的建議?
忘了提:
- 我不能使用正則表達式,因爲CLR沒有在數據庫上啓用。
- 這些數字不是順序的。當前記錄從1.1.6跳到1.2.1
- 我可以保證每個需求編號會有一對 -
{toggle-cloak:id=x.y.z}
和{cloak:id=x.y.z}
。我感興趣的是{cloak:id=x.y.z}
和{cloak}
之間的標籤。
這就是所有......一根長串嗎?在一列/行中? *(Bah到你的隱形編輯)* – Aaronaught 2010-03-24 19:25:26
UNIONs?不知道我在那裏跟着你。 – 2010-03-24 19:28:34
@Remus:處理1.1.1相關的第一個查詢,UNION ALL處理1.1.2秒等 – 2010-03-24 19:29:26