Searching for big differences between values - Mailing list pgsql-general

From Durumdara
Subject Searching for big differences between values
Date
Msg-id CAEcMXh=NgM+M+VMHbh072BEN7yqMK5j8Ndr3f8jg9MXf+rSa-Q@mail.gmail.com
Whole thread Raw
Responses Re: Searching for big differences between values  (Chris Travers <chris.travers@gmail.com>)
Re: Searching for big differences between values  (Chris Mair <chris@1006.org>)
Re: Searching for big differences between values  (Rory Campbell-Lange <rory@campbell-lange.net>)
Re: Searching for big differences between values  (Laurenz Albe <laurenz.albe@cybertec.at>)
List pgsql-general
Hello! Somewhere the users made mistakes on prices (stock). I need to search for big differences between values. For example: 20 21 21,5 30 28 .. 46392 <- 46392 <- But it could be: 42300 43100 44000 43800 65000 <- 42100 Human eye could locate these values, but there we need to check 30.000 articles and 450.000 values. Do you have any idea, how to this with SQL? In most cases the first values are ok, the second interval (after a date) it could be wrong... I don't know how to define the solution, but I think PGSQL have intelligent solution for this problem. We need to search for elements have bigger value like base price * tolerance. But the base price is calculated dynamically from the lower values... The tolerance is lower on highest base prices. Thank you for any help! Best regards dd

pgsql-general by date:

Previous
From: tao tony
Date:
Subject: copy error with json/jsonb types
Next
From: Chris Travers
Date:
Subject: Re: Searching for big differences between values