Skip to content
Advertisement

Postgres query return nothing where there should be a valid data

I have a query that should return some rows, but it returns blank. As far as I know .. the pictures down will show the issue.

Here is the query

This is the table :

the query

The table data

I tested the calculation and it worked a lone .

test the calculation Only and it works

Advertisement

Answer

Your condition cannot be right because you are comparing M.PLAYED_AT to be BETWEEN M.PLAYED_AT - X AND M.PLAYED_AT - Y – this can never be because you are comparing a timestamp with a previous timestamp and another previous timestampt.

Probably you meant to do BETWEEN ... AND (M.PLAYED_AT + M.ENDED_PREDICTION)

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement