You have gotten a lot of suggestions, but here is one more.
select * from lib_books where good_thing = 'TRUE'
MINUS
select * from lib_books where bad_thing = 'TRUE'
I think MINUS is faster than JOIN.
Other SET OPERATIONS include UNION and INTERSECT.
Set operations require that the underlying result sets be "compatible":
Same number of columns.
Corresponding columns have matching datatypes.
Ken Irwin wrote:
> Hi all,
>
> Thanks for these myriad responses! I've gotten at least three distinct
> approaches to try. I knew there had to be a better way.
>
> your sql-fu is appreciated!
>
> joys
> Ken
|