zoukankan      html  css  js  c++  java
  • sql语句带参数的模糊查询 (like @tag+'%')

    "select PK_SIR_ID,FK_SI_ID,SIR_NAME,SIR_VALUE,SIR_TAG from souce_item_results  where  FK_SI_ID in " +

                " ( select PK_SI_ID from  souce_item where SI_UNIT_NUM= @iUnitNum and SI_CALCULATE_TIME=to_date(@CalculateTime,'yyyy-MM-dd') ) as SourceItem "+

                " and SIR_TAG like @tag+'%'"

    SqlParameter[] parameters = {
         new SqlParameter("@iUnitNum", SqlDbType.Int,4),
         new SqlParameter("@CalculateTime", SqlDbType.Char,10),
         new SqlParameter("@tag", SqlDbType.VarChar,100),
                                            };

                parameters[0].Value = iUnitNum;
                parameters[1].Value = CalculateTime;
                parameters[2].Value = tag;

  • 相关阅读:
    next_permutation( ) 和prev_permutation( ) 全排列函数
    F
    STL入门
    H
    C
    提交按钮组件
    JScorllPane面板(带滚轮的JPane)
    JPanel画板
    网络布局管理器
    边界布局管理器
  • 原文地址:https://www.cnblogs.com/hbhzz/p/3227192.html
Copyright © 2011-2022 走看看