Rich Shepard <[EMAIL PROTECTED]> wrote:
  I want the latter case. In other words, if there are no records
where 'category = "natural"' nothing should be returned. It would be
nice if there was a return value that told me explicitly "no records
match the where".

You could write

select exists (select * from component where category='natural');

This produces a singleton result (single row, single column). The only cell of this result contains integer 1 if there are indeed rows with category='natural' in table component, and 0 if there are none.

I still don't understand why you want to "look before you leap", so to speak. Why not just run the query

select * from component where category='natural';

and handle the case where it produces an empty result set?

Igor Tandetnik

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

Reply via email to