This is my select:
select MY_ID, JOB_ID
from MY_TABLE
where JOB_ID != 'bra%'
and JOB_ID != 'wes%'
and STS_DTTM < trunc (sysdate) -12
It still selects fields with values that contain "bra" and "wes"
Thank you & regards,
The NOT LIKE operator in SQL is used on a column which is of type varchar . Usually, it is used with % which is used to represent any string value, including the null character \0 . The string we pass on to this operator is not case-sensitive.
Here is the answer – Technically there is no difference between != and <>. Both of them work the same way and there is absolutely no difference in terms of performance or result.
Should be:
select MY_ID, JOB_ID
from MY_TABLE
where JOB_ID not like 'bra%'
and JOB_ID not like 'wes%'
and STS_DTTM < trunc (sysdate) - 12;
And the column name should be job_name or job_code, not Job_id. Job_id sounds like a number :)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With