Is union better than or - Mailing list pgsql-general

From Michaël Fiey
Subject Is union better than or
Date
Msg-id 000801bffd72$9abc6440$6400a8c0@pc03
Whole thread Raw
List pgsql-general
Hi,
I wonder what's the best between these 2 commands :
First command :
SELECT * FROM TABLE1 WHERE COL1 like 'A%' AND COL2 LIKE 'B%' AND (COL3 LIKE 'C%' OR COL4 LIKE 'D%')
 
Second command :
SELECT * FROM TABLE1 WHERE COL1 like 'A%' AND COL2 LIKE 'B%' AND COL3 LIKE 'C%'
UNION
SELECT * FROM TABLE1 WHERE COL1 like 'A%' AND COL2 LIKE 'B%' AND COL4 LIKE 'D%'
 
Any help would be appreciated.
Thanks.

pgsql-general by date:

Previous
From: "Robert D. Nelson"
Date:
Subject: RE: Unions in views
Next
From: Craig Johannsen
Date:
Subject: Re: hierarchy select question?