Thread: Is union better than or

Is union better than or

From
Michaël Fiey
Date:
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.