Discrepancy in query output

From: Lahari Sengupta <jhinik8(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Discrepancy in query output
Date: 2018-02-22 13:20:56
Message-ID: CAKEx41qmhUgdHgovkVibPVOiC3oT+xE7B7H=uNPHbWYiCZV_Ew@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

My following query sometimes gives 72 rows and sometimes gives 71 rows as
output. How could it misses one?

SELECT distinct on (st.gid) sv.timing, st.gid, st.area
FROM servers sv
INNER JOIN sites st
ON (st_distance(sv.geom, st.geom)<8.5) where
sv.workmode = 1 AND sv.timing >= timestamp '2018-02-02 00:00:00'
and sv.timing <= timestamp '2018-02-02 23:59:59'

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Lahari Sengupta 2018-02-22 13:56:25 Re: Discrepancy in query output
Previous Message ROS Didier 2018-02-19 16:22:36 RE: barman 1.3.3 - barman list-backup ne montre pas tous les backup disponibles