Link to home
Start Free TrialLog in
Avatar of Metalteck
MetalteckFlag for United States of America

asked on

Not Like in Where Clause for Oracle

In my where clause, I have a list of job codes to exclude.
In addition, they want to exclude anything that starts with VP.
I've tried the following code, but it is still retrieving VP job codes.
I really don't want to hard code it, but wanted to know if I'm writing the code correctly.

Thanks

  and   (emp.job_code not in ('CONVP', 'EVP01', 'EVPF1', 'FEL01', 'FEL02', 'FEL03', 'FEL04', 'FEL05',  
                                       'FEL06', 'FEL07', 'FEL08', 'FEL09', 'FEL10', 'FEL12', 'FEL13', 'FEL14',  
                                       'FEL16', 'FEL17', 'FEL18', 'FEL19', 'INT01', 'INT02', 'INT03', 'INT05',  
                                       'MD-01', 'MD-02', 'MD-03', 'MD-04', 'MD-05', 'MD-06', 'MD-08', 'MDD01',
                                       'MDD02', 'MDD03', 'MDD04', 'MDD06', 'MDD09', 'MDD10', 'MDD11', 'MDD12',  
                                       'MDD13', 'MDD14', 'MDD15', 'MDD16', 'MDD17', 'MDD18', 'MDD19', 'MDD21',  
                                       'MDDC1', 'REM01', 'REM02', 'REM03')

                                        /*, 'VP-01', 'VP-02', 'VP-03', 'VP-04',
                                       'VP-06', 'VP-07', 'VP-08', 'VP-09', 'VP-10', 'VP-11', 'VP-12', 'VP-13',
                                       'VP-14', 'VP-15', 'VP-17', 'VP-18', 'VP-19', 'VP-20', 'VP-21', 'VP-22',
                                       'VP-23')*/
                  or emp.job_code not like '%VP-%')
ASKER CERTIFIED SOLUTION
Avatar of Steve Wales
Steve Wales
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Metalteck

ASKER

Thanks for the help and explanation all.