Please take this survey to help us learn more about how you use third party tools. Your input is greatly appreciated!

Bug in WHERE clause?

Hi all,
I believe I must have run into a bug with the WHERE clause in SQL on our Vertica Analytic Database v9.3.0-0.
I have the following relatively simple WHERE on a complex query:
WHERE txnYesterday.AverageBasketSizeEUR > agg90Days.avg90DayAverageBasketSizeEUR + 4 * agg90Days.stddev90DayAverageBasketSizeEUR
The values of come from subqueries that make the calculations over different time spans and result in the following:

The problem is that the resulting WHERE should be FALSE:
WHERE 20 > 20 + 4 * 0
But the row is part of the result set as if "<" would be the same as "<=".
I tried to debug the problem by replacing the columns in the query with literals, but the problem continues until I replace every column with a literal.
Test 1:

Test 2:

Test 3:

Tagged:

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file

Can't find what you're looking for? Search the Vertica Documentation, Knowledge Base, or Blog for more information.