I was wondering if its possible to add a condition like the code below in a select statement, and if it is, how should I do it ?
code that looks like these
SELECT first_name ,last_name FROM persons_table [condition: WHERE last_name is on exclusiveList]
if your exclusiveList is on another table you can do:
SELECT first_name ,last_name FROM persons_table
WHERE last_name in (select lastName from exclusiveListTable)
or even nicer: use join as a filter:
select * from -- or select A.* from
(SELECT first_name ,last_name FROM persons_table) A
inner join
(select lastName from exclusiveListTable ) B
on A.last_name = B.lastName