Reputation: 85
I wonder if it is possible to use OR operation between columns in a SELECT query?
select
first_name,
last_name
from
employee
where
(first_name OR last_name)='&enter_search_string';
Upvotes: 0
Views: 90
Reputation: 172568
You neeed to use it like this:
select
first_name,
last_name
from
employee
where first_name='first_name' OR last_name='last_name';
Upvotes: 2
Reputation: 386
Just my preference:
SELECT first_name, last_name
FROM employee
WHERE '&enter_search_string' IN (first_name, last_name)
Upvotes: 4