Subject | Check for existence of at least 1 record in result set |
---|---|
Author | Stefan Heymann |
Post date | 2007-02-07T22:43:24Z |
What is the best and least costly way to check for the existence of at
least one record in the result set of a SELECT?
I just want to know if or if not a query will return anything. I don't
care about the contents. My query involves a NATURAL scan and I want
to stop the search engine as early as possible.
Is a SELECT FIRST 1 the solution? Or is there something else which is
better?
Regards
Stefan
least one record in the result set of a SELECT?
I just want to know if or if not a query will return anything. I don't
care about the contents. My query involves a NATURAL scan and I want
to stop the search engine as early as possible.
Is a SELECT FIRST 1 the solution? Or is there something else which is
better?
Regards
Stefan