Chinaunix

标题: 如何判断一个表里面已经有那条记录了 [打印本页]

作者: diablo1999    时间: 2005-07-11 18:48
标题: 如何判断一个表里面已经有那条记录了
如果是按照ID检索的话
涉世不深
不知道怎么写
作者: chichunhua    时间: 2005-07-11 19:31
不是蠻明白你的意思,能說清楚點嗎
作者: diablo1999    时间: 2005-07-11 19:37
得到答案了
if exists()
谢谢关心
作者: pchaos    时间: 2005-07-12 11:19
select count(id) from ypurTable
where id = yourID
作者: xiamingkang    时间: 2005-07-12 12:42
标题: please test this code.
if exists(select [id] from [table] where [id] = @id)
   print \'It Found.\'
else
  print \'Can\'t find.\'




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2