我想检查用户表中是否存在id 10的记录.
@H_301_2@我试图在sql中使用exists关键字,但是我无法确定使用exists来查看是否存在记录的正确语法.
@H_301_2@我想要下面的东西
If ( exist (select id * from table where Id = id ) ) { }
解决方法
使用Exist关键字非常简单,
我在下面写了正确的语法,看看
我在下面写了正确的语法,看看
if exists (select * from [dbo].[table] where id= [the id you want to check] ) select 'True' else select 'False' return