我想检查表中是否存在id为10的记录users.
我试图exist在SQL中使用关键字,但我无法弄清楚用于exist检查记录是否存在的正确语法.
我想要下面的东西
If ( exist (select id * from table where Id = id ) )
{
}
Run Code Online (Sandbox Code Playgroud)
Kas*_*Kas 23
这很容易使用Exist关键字,我在下面写了正确的语法,检查出来
if exists (select * from [dbo].[table] where id= [the id you want to check] )
select 'True'
else
select 'False'
return
Run Code Online (Sandbox Code Playgroud)