Hello all,
I'm fairly new to Vertica and I'm running into an issue that I don't understand if I'm doing something wrong or is indeed a bug.
I'm trying to execute the following query:
SELECT
*
FROM table1 as x
WHERE
operationcontextid = 74
AND autoTag NOT LIKE '%ismaintenance%'
AND alarmTag NOT LIKE '%false_alarm%';
This query returns 0 results.
However, If I execute the query with just one of the NOT LIKE conditions it produces results and some of them do obey both initial conditions.
Example1:
SELECT
IDENTIFIER,
autoTag,
alarmTag
FROM table1 as x
WHERE
operationcontextid = 74
AND autoTag NOT LIKE '%ismaintenance%'
Result:
| IDENTIFIER | alarmTag | autoTag |
|---|---|---|
| 7707491 | #false_alarm | |
| 10544471 | ||
| 10544472 | ||
| 10544483 |
Example2:
SELECT
IDENTIFIER,
autoTag,
alarmTag
FROM table1 as x
WHERE
operationcontextid = 74
AND alarmTag NOT LIKE '%false_alarm%';
Result:
| IDENTIFIER | alarmTag | autoTag |
|---|---|---|
| 37508489 | #managed | |
| 37764004 | #managed | |
| 39564539 | #managed | |
| 41837260 | #managed |
As you can see, executing the query separately I get results for both conditions, and in both of them some results do obey the 2 LIKE conditions of the initial query but when I try to put them both together it outputs 0 results.
Instead of doing a NOT LIKE I execute the query with LIKE and specify all the possible values for each of the columns I get results but this is far from optimal because I would have to change the query every time a new value is added to one of the columns.
Is there something in Vertica's internal way of processing the query that makes it impossible to process 2 NOT LIKE conditions?
I'm running this on Vertica Analytic Database v7.2.3-16
I'm sorry if this is a real noob question but your help would be appreciated.