zoukankan      html  css  js  c++  java
  • sql xml 查询指定节点值,以及节点属性值

    SELECT   top 10  [HFMBDATA].query('(/Items/Item[@ID=''tbBryj''])').value('(//TextValue)[1]','nvarchar(max)') as mz,

    [HFMBDATA].value('(Items/Item[@ID="rb_fzhd_y"]/@ControlType)[1]','varchar(50)')   FROM [EMRCP].[dbo].[T_ZYBR_HF] as at

    获取结果:

    mz        at
    无         CheckBox.RadioBox

     

    示例XML(HFMBDATA)

    <Items>
      <Item ID="rb_cyhhjzk_h" Name="cyhhjzk" ControlType="CheckBox.RadioBox" Value="" Checked="True">
        <TextValue>好</TextValue>
      </Item>
      <Item ID="rb_cyhhjzk_yb" Name="cyhhjzk" ControlType="CheckBox.RadioBox" Value="" Checked="False">
        <TextValue>一般</TextValue>
      </Item>
      <Item ID="rb_cyhhjzk_bh" Name="cyhhjzk" ControlType="CheckBox.RadioBox" Value="" Checked="False">
        <TextValue>不好</TextValue>
      </Item>
      <Item ID="rb_sy_h" Name="sy" ControlType="CheckBox.RadioBox" Value="" Checked="True">
        <TextValue>好</TextValue>
      </Item>
      <Item ID="rb_sy_yb" Name="sy" ControlType="CheckBox.RadioBox" Value="" Checked="False">
        <TextValue>一般</TextValue>
      </Item>
      <Item ID="rb_sy_bh" Name="sy" ControlType="CheckBox.RadioBox" Value="" Checked="False">
        <TextValue>不好</TextValue>
      </Item>
      <Item ID="rb_asfy_y" Name="asfy" ControlType="CheckBox.RadioBox" Value="" Checked="False">
        <TextValue>有</TextValue>
      </Item>
      <Item ID="rb_asfy_my" Name="asfy" ControlType="CheckBox.RadioBox" Value="" Checked="False">
        <TextValue>没有</TextValue>
      </Item>
      <Item ID="rb_cxzz_y" Name="cxzz" ControlType="CheckBox.RadioBox" Value="" Checked="False">
        <TextValue>有</TextValue>
      </Item>
      <Item ID="rb_cxzz_my" Name="cxzz" ControlType="CheckBox.RadioBox" Value="" Checked="False">
        <TextValue>没有</TextValue>
      </Item>
      <Item ID="tbBryj" Name="" ControlType="InputField.Text" Value="">
        <TextValue>无</TextValue>
        <Items />
      </Item>
      <Item ID="tb_hfryyj" Name="" ControlType="InputField.Text" Value="">
        <TextValue>无</TextValue>
        <Items />
      </Item>
      <Item ID="tb_yshfyj" Name="" ControlType="InputField.Text" Value="">
        <TextValue>无</TextValue>
        <Items />
      </Item>
    </Items>

  • 相关阅读:
    Linux下安装maven
    非连续性及反脆弱
    高手是怎么练成的
    思维型大脑
    编写文档五轮模式
    Nginx初识
    ida快捷键
    ida+gdb调试任意平台
    gcc常用命令使用
    ida调试ios应用
  • 原文地址:https://www.cnblogs.com/chuhaida/p/4586200.html
Copyright © 2011-2022 走看看