Re: Search within a search.
The AND operator binds more "tightly" that the OR operator.
This is effectively what you currently have:
WHERE
(
customers.first_name LIKE '%stock%'
)
OR
( Customers.last_name LIKE '%stock%'
AND orders.`status = 22
)
You need to wrap brackets around the things you want to "stay" together:
WHERE
orders.status = 22
AND
( customers.first_name LIKE '%stock%'
OR customers.last_name LIKE '%stock%'
)
Regards, Phill W.
Subject
Written By
Posted
Re: Search within a search.
August 03, 2020 05:51AM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.