如何判断此记录是否存在于数据库中
假设在数据库中有个表table(id,a)
a存放着有规律的数据,如%12|他他%23|我们
也就是说每插入一个数字,都会以%开头,那我现在想插入数字34,我怎么样才能判断此数字是否已经存在于a字段中呢?
问题点数:10、回复次数:4Top
1 楼davidposeidon(Swimming In IT——接分啦~ 搂主给点分~)回复于 2005-08-02 09:59:15 得分 3
if exists (select id from [table] where a = '%34')Top
2 楼brando_beat(Eの懒龙)回复于 2005-08-02 10:01:46 得分 7
使用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 integer
at = str.IndexOf("he", start, count)
If at = - 1 Then
Exit While
End If
end sub
Top
3 楼huangxiaohong(红)回复于 2005-08-02 10:07:02 得分 0
brando_beat(Eの懒龙) 的还可以,但还不能表达我的要求Top
4 楼davidposeidon(Swimming In IT——接分啦~ 搂主给点分~)回复于 2005-08-02 10:12:46 得分 0
huangxiaohong(红) :
你到底啥需求? 请说清楚。Top




