假设在数据库中有个表table(id,a)
a存放着有规律的数据,如%12|他他%23|我们
也就是说每插入一个数字,都会以%开头,那我现在想插入数字34,我怎么样才能判断此数字是否已经存在于a字段中呢?

解决方案 »

  1.   

    if exists (select id from [table] where a = '%34')
      

  2.   

    使用string.Indexof()
    Public Shared Sub Main()
    Dim str As String = "Now is the time for all good men to come to the aid of their party."
    dim at as integerat = str.IndexOf("he", start, count)If at = - 1 Then
       Exit While
    End Ifend sub
      

  3.   

    brando_beat(Eの懒龙) 的还可以,但还不能表达我的要求
      

  4.   

    huangxiaohong(红) :你到底啥需求? 请说清楚。