Subject Re: [firebird-support] Check if record exist
Author Greg Strauss
"Helen Borrie" <helebor@...> wrote in message
news:5.2.0.9.2.20050127201110.03aa8d38@......
> If you just want to check for existence and return something small:
>
> select 1 from rdb$database
> where exists (select 1 from Person where PersId=:PersId)
> returns 1 if there is at least one matching row; returns empty set
> otherwise.

Would doing:
select 1 from Person where PersId=:PersId

be just as efficient (and a bit more SQL generic) than what you suggest? It
also returns 1 or empty set.

I'd like to understand the benefits (if any) of doing this...
select 1 from rdb$database
where exists (select 1 from Person where PersId=:PersId)

Thx!

Greg