P Kishor <[EMAIL PROTECTED]> wrote:
I am curious -- why is the following not a viable option here?

 SELECT Count(*) FROM components WHERE category = 'natural';

It is viable. It's potentially more expensive, as it has to enumerate all records, whereas the existence test may stop at the first one found. In fact, if there is an index on category column, the existence test doesn't need to actually read a single record.

But it appears that neiter my version nor your version is actually needed in Rich Shepard's case. Apparently, he wants to check whether the data exists, and if so, actually go and read it. Instead, he should read the data right away, and handle the case where it does _not_ exist.

Igor Tandetnik

-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to